From 2f14c0b602bf9f8f056a59498b76736d70815a57 Mon Sep 17 00:00:00 2001 From: bayanolla Date: Wed, 29 Oct 2025 16:10:16 +0300 Subject: [PATCH] Update Docker configuration for better backend service discovery --- Dockerfile | 4 ++-- nginx.conf | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index d63fb74..631a9a1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,6 @@ RUN npm run build FROM nginx:alpine COPY --from=build /app/dist /usr/share/nginx/html -COPY nginx.conf /etc/nginx/nginx.conf +COPY nginx.conf /etc/nginx/templates/nginx.conf.template EXPOSE 80 -CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file +CMD ["/docker-entrypoint.sh", "nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/nginx.conf b/nginx.conf index 3689a05..545389a 100644 --- a/nginx.conf +++ b/nginx.conf @@ -37,7 +37,7 @@ http { # Proxy API requests to the backend server location /api/ { - proxy_pass http://backend:3001/; + proxy_pass http://${BACKEND_HOST:-backend}:${BACKEND_PORT:-3001}/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade';