diff --git a/Dockerfile b/Dockerfile index 312d9bd..1637064 100644 --- a/Dockerfile +++ b/Dockerfile @@ -55,7 +55,7 @@ RUN chown nextjs:nodejs .next # Automatically leverage output traces to reduce image size # https://nextjs.org/docs/advanced-features/output-file-tracing -COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ +COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone/app ./ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static # Copy Prisma files diff --git a/nginx-zero-downtime.conf b/nginx-zero-downtime.conf index 9d3a57b..c5ebace 100644 --- a/nginx-zero-downtime.conf +++ b/nginx-zero-downtime.conf @@ -9,18 +9,6 @@ http { server portfolio-app-2:3000 max_fails=3 fail_timeout=30s; } - # Health check endpoint - server { - listen 80; - server_name _; - - location /health { - access_log off; - return 200 "healthy\n"; - add_header Content-Type text/plain; - } - } - # Main server server { listen 80; @@ -42,6 +30,13 @@ http { proxy_buffer_size 4k; proxy_buffers 8 4k; + # Health check endpoint + location /health { + access_log off; + return 200 "healthy\n"; + add_header Content-Type text/plain; + } + # Main location location / { proxy_pass http://portfolio_backend;