-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
90 lines (83 loc) · 2.02 KB
/
docker-compose.prod.yml
File metadata and controls
90 lines (83 loc) · 2.02 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
86
87
88
89
90
# Production overrides for Docker Compose
# Adds production optimizations, security settings, and restart policies
# Usage: docker-compose -f docker-compose.yml -f docker-compose.database.yml -f docker-compose.app.yml -f docker-compose.nginx.yml -f docker-compose.prod.yml up
version: '3.8'
services:
postgres:
restart: always
environment:
POSTGRES_INITDB_ARGS: "--encoding=UTF8 --lc-collate=en_US.utf8 --lc-ctype=en_US.utf8"
deploy:
resources:
limits:
cpus: '2'
memory: 2G
reservations:
cpus: '1'
memory: 1G
redis:
restart: always
command: redis-server --appendonly yes --requirepass ${REDIS_PASSWORD:-}
deploy:
resources:
limits:
cpus: '1'
memory: 512M
backend:
restart: always
environment:
ENVIRONMENT: production
LOG_LEVEL: INFO
WORKERS: 4
command: uvicorn main:app --host 0.0.0.0 --port 5000 --workers 4
deploy:
resources:
limits:
cpus: '2'
memory: 1G
reservations:
cpus: '0.5'
memory: 512M
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
frontend:
restart: always
environment:
NODE_ENV: production
deploy:
resources:
limits:
cpus: '1'
memory: 512M
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
nginx:
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./docker/nginx/conf.d:/etc/nginx/conf.d:ro
- ./docker/nginx/ssl:/etc/nginx/ssl:ro
- ./docker/nginx/cache:/var/cache/nginx
deploy:
resources:
limits:
cpus: '1'
memory: 256M
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
pgadmin:
restart: always
profiles:
- tools # Only start when explicitly requested