Add frontend container (nginx) with api proxy, restore two-container architecture

This commit is contained in:
Agent Zero
2026-05-25 18:36:41 +00:00
parent aa17e212bc
commit 385861f486
+27
View File
@@ -50,5 +50,32 @@ services:
start_period: 40s start_period: 40s
restart: unless-stopped restart: unless-stopped
frontend:
image: nginx:alpine
working_dir: /app
expose:
- "80"
command:
- sh
- '-c'
- |
apk add --no-cache git nodejs npm curl
git clone --depth 1 https://forgejo.media-on.de/Leopoldadmin/web-cad.git /tmp/repo
cd /tmp/repo/frontend
npm ci
npx vite build --mode production
cp -r dist/* /usr/share/nginx/html/
cp nginx.conf /etc/nginx/conf.d/default.conf
nginx -g 'daemon off;'
depends_on:
- backend
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:80/"]
interval: 15s
timeout: 5s
retries: 15
start_period: 120s
restart: unless-stopped
volumes: volumes:
pg_data: pg_data: