fix: frontend and backend now get variables at build time not runtime

This commit is contained in:
theoleuthardt 2025-02-28 11:29:44 +01:00
parent 607d496f2a
commit 776ed29bca
6 changed files with 17 additions and 11 deletions

View file

@ -1,30 +1,32 @@
services:
frontend:
env_file: .env
build:
context: ./frontend
dockerfile: Dockerfile
args:
NEXT_PUBLIC_BACKEND_URL: ${NEXT_PUBLIC_BACKEND_URL}
container_name: werkzeugkiste-frontend
env_file: .env
environment:
- NODE_ENV=${NODE_ENV}
- HOSTNAME=${HOSTNAME}
- PORT=${FRONTEND_PORT}
- NEXT_PUBLIC_BACKEND_URL=${NEXT_PUBLIC_BACKEND_URL}
ports:
- "${FRONTEND_PORT}:3000"
restart: unless-stopped
backend:
env_file: .env
build:
context: ./backend
dockerfile: Dockerfile
args:
CORS_ALLOWED_ORIGIN: ${CORS_ALLOWED_ORIGIN}
container_name: werkzeugkiste-backend
env_file: .env
environment:
- NODE_ENV=${NODE_ENV}
- HOSTNAME=${HOSTNAME}
- PORT=${BACKEND_PORT}
- CORS_ALLOWED_ORIGIN=${CORS_ALLOWED_ORIGIN}
ports:
- "${BACKEND_PORT}:4000"
restart: unless-stopped