-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
101 lines (93 loc) · 2.33 KB
/
docker-compose.prod.yml
File metadata and controls
101 lines (93 loc) · 2.33 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
91
92
93
94
95
96
97
98
99
100
101
version: '3.8'
services:
nginx:
image: nginx:latest
container_name: prod-nginx
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- /etc/letsencrypt:/etc/letsencrypt
- /var/lib/letsencrypt:/var/lib/letsencrypt
depends_on:
- backend
networks:
- backend-net
redis:
image: redis:7
container_name: prod-redis
restart: unless-stopped
ports:
- "6379:6379"
volumes:
- redis-data:/data
command: redis-server --appendonly yes
networks:
- backend-net
backend:
image: foureach/ctrlu-backend:latest
container_name: backend
restart: unless-stopped
env_file:
- .env.prod
networks:
- backend-net
volumes:
# 호스트의 /var/log/ctrlu-app-logs 디렉토리를 컨테이너의 /app/logs 디렉토리로 마운트
- /var/log/ctrlu-app-logs:/app/logs
certbot-renew:
image: certbot/certbot
container_name: certbot-renew
volumes:
- /etc/letsencrypt:/etc/letsencrypt
- /var/lib/letsencrypt:/var/lib/letsencrypt
entrypoint: >
sh -c "while true; do
certbot renew --webroot -w /var/lib/letsencrypt --quiet &&
echo '✔ Renewed! Reloading nginx...' &&
docker exec prod-nginx nginx -s reload;
sleep 12h;
done"
networks:
- backend-net
depends_on:
- nginx
# prometheus:
# image: prom/prometheus
# container_name: prometheus
# restart: unless-stopped
# ports:
# - "9090:9090"
# volumes:
# - ./prometheus.yml:/etc/prometheus/prometheus.yml
# - prometheus-data:/prometheus
# command:
# - '--config.file=/etc/prometheus/prometheus.yml'
# - '--storage.tsdb.path=/prometheus'
# - '--web.enable-lifecycle'
# networks:
# - backend-net
# grafana:
# image: grafana/grafana
# container_name: grafana
# restart: unless-stopped
# ports:
# - "3000:3000"
# env_file:
# - .env.prod
# environment:
# - GF_SECURITY_ADMIN_USER=admin
# - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_ADMIN_PASSWORD}
# volumes:
# - grafana_data:/var/lib/grafana
# networks:
# - backend-net
volumes:
redis-data:
# prometheus-data:
# grafana_data:
networks:
backend-net:
driver: bridge