mirror of
https://github.com/Grace-Solutions/Depl0y-Custom.git
synced 2026-07-26 11:28:19 +00:00
feat(docker/frontend): make backend URL configurable via env
This commit is contained in:
@@ -14,5 +14,7 @@ FRONTEND_IMAGENAME=Agit8or/Depl0y-frontend
|
|||||||
FRONTEND_IMAGEVERSION=latest
|
FRONTEND_IMAGEVERSION=latest
|
||||||
FRONTEND_ENABLEAUTOMATICUPDATES=true
|
FRONTEND_ENABLEAUTOMATICUPDATES=true
|
||||||
FRONTEND_PORT_EXTERNAL=8080
|
FRONTEND_PORT_EXTERNAL=8080
|
||||||
|
BACKEND_BASEURL=http://backend:8000
|
||||||
|
|
||||||
###END FRONTEND###
|
###END FRONTEND###
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ ENV APP_VERSION=${APP_VERSION}
|
|||||||
COPY src/frontend/dist /usr/share/nginx/html
|
COPY src/frontend/dist /usr/share/nginx/html
|
||||||
|
|
||||||
# Custom nginx config for SPA routing (serve index.html for unknown routes)
|
# Custom nginx config for SPA routing (serve index.html for unknown routes)
|
||||||
COPY deployment/docker/frontend/nginx.conf /etc/nginx/conf.d/default.conf
|
# Use nginx's built-in template support to env-substitute BACKEND_BASEURL
|
||||||
|
COPY deployment/docker/frontend/nginx.conf /etc/nginx/templates/default.conf.template
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ services:
|
|||||||
logging:
|
logging:
|
||||||
driver: 'local'
|
driver: 'local'
|
||||||
#env_file: '.env'
|
#env_file: '.env'
|
||||||
|
environment:
|
||||||
|
BACKEND_BASEURL: '${BACKEND_BASEURL:-http://backend:8000}'
|
||||||
networks:
|
networks:
|
||||||
EXTERNAL:
|
EXTERNAL:
|
||||||
ports:
|
ports:
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ server {
|
|||||||
try_files $uri /index.html;
|
try_files $uri /index.html;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Backend API - expects a backend service reachable at http://backend:8000
|
# Backend API - configurable via BACKEND_BASEURL (e.g. http://backend:8000)
|
||||||
location /api {
|
location /api {
|
||||||
proxy_pass http://backend:8000;
|
proxy_pass $BACKEND_BASEURL;
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
proxy_set_header Connection 'upgrade';
|
proxy_set_header Connection 'upgrade';
|
||||||
|
|||||||
Reference in New Issue
Block a user