-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
138 lines (130 loc) · 3.19 KB
/
docker-compose.yml
File metadata and controls
138 lines (130 loc) · 3.19 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
services:
redis:
image: redis:7-alpine
restart: unless-stopped
volumes:
- redis_data:/data
networks:
- coresend-network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 10s
retries: 3
backend:
build:
context: ./backend
dockerfile: Dockerfile
restart: unless-stopped
ports:
- "25:1025"
- "8080:8080"
environment:
- REDIS_ADDR=redis:6379
- REDIS_PASSWORD=${REDIS_PASSWORD:-}
- DOMAIN_NAME=${DOMAIN_NAME}
- SMTP_LISTEN_ADDR=:1025
- HTTP_LISTEN_ADDR=:8080
- SMTP_CERT_PATH=/certs/${DOMAIN_NAME}/${DOMAIN_NAME}.crt
- SMTP_KEY_PATH=/certs/${DOMAIN_NAME}/${DOMAIN_NAME}.key
depends_on:
redis:
condition: service_healthy
volumes:
- caddy_certs:/certs:ro
networks:
- coresend-network
healthcheck:
test: ["CMD", "sh", "-c", "nc -z localhost 1025 && nc -z localhost 8080"]
interval: 30s
timeout: 10s
retries: 3
caddy:
image: caddy:alpine
restart: unless-stopped
ports:
- "80:80"
- "443:443"
environment:
- DOMAIN_NAME=${DOMAIN_NAME}
volumes:
- ./caddy/Caddyfile:/etc/caddy/Caddyfile:ro
- ./frontend/dist:/srv/frontend:ro
- caddy_data:/data
- caddy_certs:/data/caddy/certificates/acme-v02.api.letsencrypt.org-directory
- caddy_config:/config
depends_on:
- backend
networks:
- coresend-network
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost/health"]
interval: 30s
timeout: 10s
retries: 3
redis-exporter:
image: oliver006/redis_exporter:latest
restart: unless-stopped
environment:
- REDIS_ADDR=redis://redis:6379
- REDIS_PASSWORD=${REDIS_PASSWORD:-}
networks:
- coresend-network
depends_on:
redis:
condition: service_healthy
node-exporter:
image: prom/node-exporter:latest
restart: unless-stopped
networks:
- coresend-network
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- '--path.procfs=/host/proc'
- '--path.sysfs=/host/sys'
- '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)'
prometheus:
image: prom/prometheus:latest
restart: unless-stopped
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--storage.tsdb.retention.time=15d'
networks:
- coresend-network
depends_on:
- redis-exporter
- node-exporter
grafana:
image: grafana/grafana:latest
restart: unless-stopped
ports:
- "3000:3000"
volumes:
- grafana_data:/var/lib/grafana
networks:
- coresend-network
depends_on:
- prometheus
volumes:
redis_data:
driver: local
caddy_data:
driver: local
caddy_certs:
driver: local
caddy_config:
driver: local
prometheus_data:
driver: local
grafana_data:
driver: local
networks:
coresend-network:
driver: bridge