Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
87 lines (80 loc) · 2.06 KB
/
Copy pathdocker-compose.yml
File metadata and controls
87 lines (80 loc) · 2.06 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
services:
web:
build: .
restart: unless-stopped
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
environment:
DATABASE_URL: ${DATABASE_URL}
REDIS_URL: ${REDIS_URL}
db:
image: postgres:17
restart: always
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 5
volumes:
- postgres_data:/var/lib/postgresql/data
redis:
image: redis:alpine
restart: always
command: redis-server --requirepass ${REDIS_PASSWORD}
environment:
REDIS_PASSWORD: ${REDIS_PASSWORD}
REDIS_DB: ${REDIS_DB}
healthcheck:
test: ["CMD-SHELL", "redis-cli -a $${REDIS_PASSWORD} ping | grep PONG"]
interval: 5s
timeout: 3s
retries: 5
nginx:
image: nginx:alpine
restart: unless-stopped
ports:
- "80:80"
- "443:443"
environment:
- DOMAIN=${DOMAIN}
depends_on:
- web
volumes:
- ./nginx/default.conf.template:/etc/nginx/templates/default.conf.template:ro
- certbot_conf:/etc/letsencrypt
- certbot_www:/var/www/certbot
prometheus:
image: prom/prometheus
restart: unless-stopped
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus_data:/prometheus
grafana:
image: grafana/grafana
restart: unless-stopped
environment:
GF_SERVER_ROOT_URL: "https://${DOMAIN}/grafana/"
GF_SERVER_SERVE_FROM_SUB_PATH: true
volumes:
- grafana_data:/var/lib/grafana
certbot:
image: certbot/certbot:latest
restart: unless-stopped
profiles: ["prod"]
volumes:
- certbot_conf:/etc/letsencrypt
- certbot_www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do sleep 6h & wait $${!}; done;'"
volumes:
postgres_data:
certbot_conf:
certbot_www:
grafana_data:
prometheus_data: