-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
98 lines (91 loc) · 2.56 KB
/
docker-compose.yml
File metadata and controls
98 lines (91 loc) · 2.56 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
services:
redis:
image: redis:7-alpine
restart: unless-stopped
# appendonly: persist the queue to disk so it survives restarts.
# appendfsync everysec: at most 1 second of data loss, balanced against write performance.
command: redis-server --appendonly yes --appendfsync everysec
volumes:
- redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
server:
build: .
command: node src/server.js
restart: unless-stopped
env_file: .env
environment:
PORT: "3000"
REDIS_URL: "redis://redis:6379"
depends_on:
redis:
condition: service_healthy
# Scale horizontally with: docker compose up --scale worker=N
worker:
build: .
command: node src/worker.js
restart: unless-stopped
env_file: .env
environment:
REDIS_URL: "redis://redis:6379"
METRICS_ENABLED: "${METRICS_ENABLED:-false}"
METRICS_PORT: "${METRICS_PORT:-9091}"
ports:
- "${METRICS_PORT:-9091}:${METRICS_PORT:-9091}"
depends_on:
redis:
condition: service_healthy
prometheus:
image: prom/prometheus:v3.3.0
profiles: [monitoring]
restart: unless-stopped
volumes:
- ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus-data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.retention.time=30d'
depends_on:
- server
- worker
grafana:
image: grafana/grafana:11.6.0
profiles: [monitoring]
restart: unless-stopped
environment:
GF_AUTH_ANONYMOUS_ENABLED: "true"
GF_AUTH_ANONYMOUS_ORG_ROLE: "Viewer"
volumes:
- ./monitoring/grafana/provisioning:/etc/grafana/provisioning:ro
- ./monitoring/grafana/dashboards:/var/lib/grafana/dashboards:ro
- grafana-data:/var/lib/grafana
ports:
- "3001:3000"
depends_on:
- prometheus
nginx:
image: nginx:1.27-alpine
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/conf.d:/etc/nginx/conf.d:ro
- ./data/certbot/www:/var/www/certbot:ro
- ./data/certbot/certs:/etc/letsencrypt:ro
depends_on:
- server
# Run via scripts/init-tls.sh for initial issuance, then on a timer for renewals:
# docker compose run --rm certbot renew
certbot:
image: certbot/certbot:latest
volumes:
- ./data/certbot/www:/var/www/certbot
- ./data/certbot/certs:/etc/letsencrypt
volumes:
redis-data:
prometheus-data:
grafana-data: