Add frontend and Caddy to Docker Compose dev environment

Containerize the frontend dev server (Vite) and add a Caddy reverse
proxy for HTTPS termination, replacing the manual local setup. The
Caddy config proxies /api/* to the backend and everything else to the
frontend dev server.

Also simplify start.sh: remove --local Poetry mode, extract
get_compose_cmd helper, and document new services and DEV_HOST env var.
This commit is contained in:
Viktor Barzin 2026-02-06 23:45:29 +00:00
parent 2626870396
commit e55902d813
No known key found for this signature in database
GPG key ID: 0EB088298288D958
3 changed files with 89 additions and 92 deletions

View file

@ -1,5 +1,3 @@
version: "3.8"
services:
redis:
image: redis:8
@ -111,6 +109,37 @@ services:
networks:
- rec-network
frontend:
image: node:24-alpine
container_name: rec-frontend
working_dir: /app
ports:
- "5173:5173"
volumes:
- ./frontend:/app
- frontend_node_modules:/app/node_modules
environment:
- DEV_HOST=${DEV_HOST:-localhost}
command: sh -c "npm ci && npm run dev -- --host"
networks:
- rec-network
caddy:
image: caddy:alpine
container_name: rec-caddy
ports:
- "443:443"
volumes:
- ./frontend/Caddyfile.dev:/etc/caddy/Caddyfile
- caddy_data:/data
environment:
- DEV_HOST=${DEV_HOST:-localhost}
depends_on:
- frontend
- app
networks:
- rec-network
networks:
rec-network:
driver: bridge
@ -119,3 +148,5 @@ volumes:
redis_data:
mysql_data:
app_venv:
frontend_node_modules:
caddy_data: