-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
64 lines (60 loc) · 1.4 KB
/
docker-compose.prod.yml
File metadata and controls
64 lines (60 loc) · 1.4 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
# ─── Production ───
# Usage: make prod or docker compose -f docker-compose.prod.yml up --build -d
services:
db:
image: postgres:16-alpine
env_file: .env.prod
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- pg-data:/var/lib/postgresql/data
restart: always
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
interval: 10s
timeout: 5s
retries: 5
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
api:
build:
context: .
dockerfile: docker/Dockerfile.api
ports:
- "${API_PORT:-8080}:8080"
env_file: .env.prod
environment:
- PORT=8080
- APP_ENV=production
- CONTENT_DIR=/app/content
- DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}?sslmode=disable
depends_on:
db:
condition: service_healthy
restart: always
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
web:
build:
context: .
dockerfile: docker/Dockerfile.web.prod
ports:
- "${WEB_PORT:-80}:80"
depends_on:
- api
restart: always
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
volumes:
pg-data: