-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
38 lines (35 loc) · 1.06 KB
/
Copy pathdocker-compose.prod.yml
File metadata and controls
38 lines (35 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Production overlay for a free VM (e.g. Oracle Cloud Always Free) that
# hosts the BACKEND ONLY -- the frontend stays on Vercel and reaches this
# over the network via NEXT_PUBLIC_API_URL.
#
# Usage: docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d --build db api caddy
# (deliberately omits `web`: the Next.js container has no purpose on this
# VM when Vercel already serves the frontend)
#
# Puts Caddy in front as the only publicly-exposed service (80/443) and
# stops publishing host ports for db/api directly, since on a real VM
# (unlike local dev) those ports are reachable from the internet, not just
# localhost.
services:
db:
ports: []
api:
ports: []
caddy:
image: caddy:2-alpine
container_name: cardiovascular-risk-caddy
ports:
- "80:80"
- "443:443"
environment:
- SITE_ADDRESS=${SITE_ADDRESS:-:80}
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- caddy-data:/data
- caddy-config:/config
depends_on:
- api
restart: unless-stopped
volumes:
caddy-data:
caddy-config: