-
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 (86 loc) · 1.9 KB
/
docker-compose.prod.yml
File metadata and controls
90 lines (86 loc) · 1.9 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
services:
app:
image: ${DOCKER_IMAGE:-ghcr.io/jdy8739/daiily:latest}
build: . # Fallback for local development
environment:
- NODE_ENV=production
- DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD}@db:5432/daiily
- NEXT_PUBLIC_DEPLOYMENT_ID=${DEPLOYMENT_ID:-$(date +%s)}
env_file:
- .env
expose:
- "3000"
volumes:
- ./backups:/app/backups
networks:
- app-network
depends_on:
db:
condition: service_healthy
restart: unless-stopped
deploy:
resources:
limits:
memory: 400M
cpus: "0.5"
reservations:
memory: 200M
cpus: "0.25"
nginx:
image: nginx:alpine
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
- ./ssl:/etc/nginx/ssl
networks:
- app-network
depends_on:
- app
restart: unless-stopped
deploy:
resources:
limits:
memory: 50M
cpus: "0.2"
reservations:
memory: 20M
cpus: "0.1"
db:
image: postgres:16-alpine
environment:
POSTGRES_DB: daiily
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
command: >
postgres
-c shared_buffers=32MB
-c effective_cache_size=128MB
-c work_mem=2MB
-c maintenance_work_mem=16MB
-c max_connections=20
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- app-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d daiily"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
restart: unless-stopped
deploy:
resources:
limits:
memory: 200M
cpus: "0.3"
reservations:
memory: 100M
cpus: "0.1"
networks:
app-network:
driver: bridge
volumes:
postgres_data: