-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-compose.yml
155 lines (142 loc) · 3.57 KB
/
docker-compose.yml
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
version: '3.9'
services:
# Frontend service
frontend:
container_name: frontend
env_file:
- ./src/frontend/frontend.env
restart: unless-stopped
build: ./src/frontend
command: index.js
volumes:
- log-volume:/home/app/logs
# Backend Service
backend:
container_name: backend
env_file:
- ./src/backend/backend.env
restart: unless-stopped
build: ./src/backend
ports:
- "5000:5000"
volumes:
- log-volume:/home/app/logs
command: setup.py -s backend
depends_on:
- redis-primary
- redis-secondary
- datasync
- frontend
# Data sync service
datasync:
container_name: datasync
env_file:
- ./src/backend/backend.env
restart: unless-stopped
build: ./src/backend
ports:
- "5001:5001"
volumes:
- log-volume:/home/app/logs
command: setup.py -s sync
depends_on:
- redis-primary
- redis-secondary
# Public Stats Service
public:
container_name: public
env_file:
- ./src/backend/backend.env
restart: unless-stopped
build: ./src/backend
volumes:
- log-volume:/home/app/logs
command: setup.py -s public
ports:
- "5002:5002"
depends_on:
- redis-primary
- redis-secondary
- datasync
- frontend
# Primary redis
redis-primary:
container_name: redis-primary
image: docker.io/bitnami/redis:6.2
restart: unless-stopped
ports:
- '6379'
env_file:
- ./src/backend/redis-primary.env
volumes:
- 'redis_data:/bitnami/redis/data'
# Secondary Redis
redis-secondary:
container_name: redis-secondary
image: docker.io/bitnami/redis:6.2
restart: unless-stopped
ports:
- '6379'
depends_on:
- redis-primary
env_file:
- ./src/backend/redis-secondary.env
# Prometheus
# Prometheus config.yml is configured to point to Grafana Cloud
prometheus:
container_name: prometheus
build: ./src/prometheus
restart: unless-stopped
env_file:
- ./src/prometheus/prometheus.env
volumes:
- ./src/prometheus/config.yml:/etc/prometheus/config.yml
ports:
- 9090:9090
# Promtail is used to send our logs to Grafana cloud
# Promtail config.yml is configured to point to Grafana Cloud Loki instance
promtail:
container_name: promtail
image: grafana/promtail:2.4.2
volumes:
- ./src/promtail/config.yml:/etc/promtail/config.yml
- log-volume:/home/app/logs
command: -config.file=/etc/promtail/config.yml -config.expand-env=true
env_file:
- ./src/promtail/promtail.env
# Grafana for visualization
# Commented out because we are using Grafana Cloud instead
#grafana:
# container_name: grafana
# image: grafana/grafana:5.1.0
# volumes:
# - ./src/grafana/config.ini:/etc/grafana/grafana.ini
# - ./src/grafana/datasource.yaml:/etc/grafana/provisioning/datasources/default.yaml
# - ./src/grafana/dashboard.yaml:/etc/grafana/provisioning/dashboards/default.yaml
# - ./src/grafana/dashboards:/var/lib/grafana/dashboards
# ports:
# - 3000:3000
caddy:
container_name: caddy
image: caddy:2.5.2
restart: unless-stopped
env_file:
- ./src/caddy/caddy.env
ports:
- "80:80"
- "443:443"
volumes:
- ./src/caddy/Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data
- caddy_config:/config
depends_on:
- public
environment:
PROXY_BACKEND: public
PROXY_PORT: 5002
volumes:
redis_data:
driver: local
caddy_data:
caddy_config:
log-volume: