-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
69 lines (64 loc) · 1.46 KB
/
docker-compose.prod.yml
File metadata and controls
69 lines (64 loc) · 1.46 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
version: '3.8'
# Production overrides
services:
postgres:
# In production, you might want to use a managed database
# or at least add better security
environment:
POSTGRES_DB: ${PSQL_DB}
POSTGRES_USER: ${PSQL_USER}
POSTGRES_PASSWORD: ${PSQL_PW}
volumes:
- postgres_data:/var/lib/postgresql/data
- ./backups:/backups # For database backups
# No ports exposed in production - only internal network
expose:
- "5432"
ports: []
efdata-app:
environment:
- ENVIRONMENT=production
- LOG_LEVEL=INFO
# Add resource limits
deploy:
resources:
limits:
cpus: '2'
memory: 2G
reservations:
cpus: '1'
memory: 1G
efdata-api:
environment:
- ENVIRONMENT=production
- LOG_LEVEL=INFO
# Use a reverse proxy in production instead of exposing directly
expose:
- "8001"
ports: []
deploy:
resources:
limits:
cpus: '1'
memory: 1G
reservations:
cpus: '0.5'
memory: 512M
# Add nginx reverse proxy for production
nginx:
image: nginx:alpine
container_name: efdata-nginx
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./ssl:/etc/nginx/ssl:ro
depends_on:
- efdata-api
restart: always
volumes:
postgres_data:
name: efdata_postgres_data_prod
backups:
name: efdata_backups