Repository navigation
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
76 lines (69 loc) · 1.65 KB
/
Copy pathdocker-compose.prod.yml
File metadata and controls
76 lines (69 loc) · 1.65 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
services:
postgres:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 5
networks:
- internal
backend:
build:
context: ./deploy/docker/api.Dockerfile
dockerfile: apps/backend/Dockerfile
restart: unless-stopped
environment:
DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
NODE_ENV: production
depends_on:
postgres:
condition: service_healthy
networks:
- internal
frontend:
build:
context: ./apps/front-sveltekit/docker/frontend.Dockerfile
dockerfile: apps/web/Dockerfile
restart: unless-stopped
environment:
NODE_ENV: production
API_URL_INTERNAL: http://backend:${BACKEND_PORT_INTERNAL}
PUBLIC_API_URL: https://${DOMAIN}/api
depends_on:
- backend
networks:
- internal
- proxy_network
caddy:
image: caddy:2-alpine
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data
- caddy_config:/config
depends_on:
- frontend
- backend
networks:
- internal
networks:
internal:
driver: bridge
proxy_network:
driver: bridge
external: true
volumes:
postgres_data:
caddy_data:
caddy_config: