diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..8140bbb --- /dev/null +++ b/.dockerignore @@ -0,0 +1,10 @@ +node_modules +.next +.git +.gitignore +.claude +*.md +.env*.local +npm-debug.log* +yarn-debug.log* +yarn-error.log* diff --git a/Dockerfile b/Dockerfile index 14e27b8..1cec27e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,8 +13,7 @@ WORKDIR /app ENV NODE_ENV=production -RUN npm install next --save - +# Copy standalone output COPY --from=builder /app/.next/standalone ./ COPY --from=builder /app/.next/static ./.next/static COPY --from=builder /app/public ./public @@ -24,4 +23,4 @@ EXPOSE 3000 ENV PORT=3000 ENV HOSTNAME="0.0.0.0" -CMD ["npm", "start"] +CMD ["node", "server.js"] diff --git a/next.config.mjs b/next.config.mjs index f26ac37..2937c03 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,3 +1,5 @@ /** @type {import('next').NextConfig} */ -const nextConfig = {}; +const nextConfig = { + output: 'standalone', +}; export default nextConfig;