From 44c9d70ed659a5d60d9e42d0fbe1cc2758aa3d0f Mon Sep 17 00:00:00 2001 From: SonAIengine Date: Thu, 18 Dec 2025 12:13:45 +0900 Subject: [PATCH] refactor: Update Dockerfile to use build arguments for backend host and port, and streamline file copying process --- Dockerfile | 11 ++++++----- next.config.ts | 1 - 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9a4349d1..604e09ad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,8 +11,8 @@ RUN npm ci COPY . . # Build arguments for environment variables (needed at build time for Next.js) -ARG NEXT_PUBLIC_BACKEND_HOST=http://host.docker.internal -ARG NEXT_PUBLIC_BACKEND_PORT=8023 +ARG NEXT_PUBLIC_BACKEND_HOST +ARG NEXT_PUBLIC_BACKEND_PORT ARG NEXT_PUBLIC_METRICS_HOST # Set environment variables for build @@ -37,8 +37,9 @@ RUN adduser --system --uid 1001 nextjs # Copy necessary files from builder COPY --from=builder /app/public ./public -COPY --from=builder /app/.next/standalone ./ -COPY --from=builder /app/.next/static ./.next/static +COPY --from=builder /app/.next ./.next +COPY --from=builder /app/node_modules ./node_modules +COPY --from=builder /app/package.json ./package.json # Set correct permissions RUN chown -R nextjs:nodejs /app @@ -49,4 +50,4 @@ EXPOSE 3000 ENV PORT=3000 ENV HOSTNAME="0.0.0.0" -CMD ["node", "server.js"] +CMD ["npm", "start"] diff --git a/next.config.ts b/next.config.ts index 073e4515..8e70feba 100644 --- a/next.config.ts +++ b/next.config.ts @@ -1,7 +1,6 @@ import type { NextConfig } from 'next'; const nextConfig: NextConfig = { - output: 'standalone', experimental: { proxyTimeout: 600000, },