diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 00f8746..2b32dea 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -21,8 +21,11 @@ FROM nginx:alpine # Copy built files COPY --from=build /app/dist /usr/share/nginx/html -# Copy nginx config -COPY nginx.conf /etc/nginx/conf.d/default.conf +# Copy nginx template (processed at startup with envsubst) +COPY nginx.conf.template /etc/nginx/templates/default.conf.template + +# Default API URL (override with -e API_URL=...) +ENV API_URL=http://api:8000/ EXPOSE 80 diff --git a/frontend/nginx.conf b/frontend/nginx.conf.template similarity index 96% rename from frontend/nginx.conf rename to frontend/nginx.conf.template index a16abcf..b36c4df 100644 --- a/frontend/nginx.conf +++ b/frontend/nginx.conf.template @@ -15,7 +15,7 @@ server { # Proxy API requests to backend location /api/ { - proxy_pass http://api:8000/; + proxy_pass ${API_URL}; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade';