diff --git a/webapp/Dockerfile b/webapp/Dockerfile index 2098f92..4a99c9b 100644 --- a/webapp/Dockerfile +++ b/webapp/Dockerfile @@ -11,11 +11,7 @@ RUN npm ci COPY webapp/ . # Set environment variables for build -# Use a dummy DB_URI during build to prevent connection attempts -ENV DB_URI="mongodb://dummy:password@localhost:27017/dummy" ENV NODE_ENV=production - -# Disable Next.js telemetry during build ENV NEXT_TELEMETRY_DISABLED=1 # Build the application @@ -33,10 +29,13 @@ RUN addgroup --system --gid 1001 nodejs RUN adduser --system --uid 1001 nextjs # Copy the built application from the builder stage +COPY --from=deps /app/next.config.js . COPY --from=deps /app/public ./public +COPY --from=deps /app/package.json ./package.json -# Automatically leverage output traces to reduce image size +# Copy .next/standalone COPY --from=deps --chown=nextjs:nodejs /app/.next/standalone ./ +# Copy .next/static COPY --from=deps --chown=nextjs:nodejs /app/.next/static ./.next/static # Set the user to non-root