Update frontend Dockerfile prod stage from Caddy static to Node.js running Astro SSR server. Configure caddy-docker-proxy labels to route /api/* to backend and everything else to frontend on the same domain. Support empty PUBLIC_API_URL for same-origin API calls.
34 lines
692 B
YAML
34 lines
692 B
YAML
services:
|
|
backend:
|
|
build:
|
|
context: ./backend
|
|
dockerfile: Dockerfile
|
|
target: prod
|
|
expose:
|
|
- "8000"
|
|
networks:
|
|
- default
|
|
- caddy
|
|
labels:
|
|
caddy: "${SPICEBOOK_DOMAIN:-spicebook.localhost}"
|
|
caddy.@api.path: "/api/* /health /docs /openapi.json /redoc"
|
|
caddy.reverse_proxy_0: "@api {{upstreams 8000}}"
|
|
|
|
frontend:
|
|
build:
|
|
context: ./frontend
|
|
dockerfile: Dockerfile
|
|
target: prod
|
|
expose:
|
|
- "4321"
|
|
networks:
|
|
- default
|
|
- caddy
|
|
labels:
|
|
caddy: "${SPICEBOOK_DOMAIN:-spicebook.localhost}"
|
|
caddy.reverse_proxy_1: "{{upstreams 4321}}"
|
|
|
|
networks:
|
|
caddy:
|
|
external: true
|