-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
85 lines (78 loc) · 2.04 KB
/
Copy pathdocker-compose.prod.yml
File metadata and controls
85 lines (78 loc) · 2.04 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
77
78
79
80
81
82
83
84
85
# Production overrides — run with:
# docker compose -f docker-compose.yml -f docker-compose.prod.yml --profile prod up -d
#
# Requires a .env file with strong secrets (see .env.production.example)
#
# What this adds:
# - Removes host port bindings (only nginx exposes 80/443)
# - Enforces required env vars (no dev defaults)
# - Upgrades restart policy to 'always'
# - Adds JSON log rotation to all services
# - Bumps Redis maxmemory for production load
services:
postgres:
restart: always
ports: !override []
environment:
POSTGRES_USER: ${POSTGRES_USER:?POSTGRES_USER must be set}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD must be set}
POSTGRES_DB: ${POSTGRES_DB:-cookquest}
logging:
driver: json-file
options:
max-size: '10m'
max-file: '3'
redis:
restart: always
command: >
redis-server
--maxmemory 256mb
--maxmemory-policy allkeys-lru
--requirepass ${REDIS_PASSWORD:?REDIS_PASSWORD must be set}
logging:
driver: json-file
options:
max-size: '10m'
max-file: '3'
cookquest-web:
restart: always
ports: !override []
environment:
- NODE_ENV=production
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL:?NEXT_PUBLIC_API_URL must be set}
logging:
driver: json-file
options:
max-size: '10m'
max-file: '3'
cookquest-api:
restart: always
ports: !override []
environment:
- NODE_ENV=production
- JWT_SECRET=${JWT_SECRET:?JWT_SECRET must be set}
- FRONTEND_URL=${FRONTEND_URL:?FRONTEND_URL must be set}
logging:
driver: json-file
options:
max-size: '10m'
max-file: '3'
nginx:
restart: always
logging:
driver: json-file
options:
max-size: '10m'
max-file: '3'
certbot:
logging:
driver: json-file
options:
max-size: '5m'
max-file: '2'
backup:
logging:
driver: json-file
options:
max-size: '5m'
max-file: '2'