-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
239 lines (239 loc) · 8.24 KB
/
docker-compose.yaml
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
version: "3.9"
services:
traefik:
image: traefik:v2.4
container_name: traefik
command:
- "--log.level=ERROR"
- "--api.dashboard=true"
- "--accesslog=true"
- "--tracing.jaeger=true"
- "--metrics.prometheus=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--providers.docker.network=main-network"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--entrypoints.bolt.address=:7687"
- "--entrypoints.neo4j.address=:7474"
- "--entrypoints.neo4j-secure.address=:7473"
- "--entrypoints.mongo.address=:27017"
- "--entrypoints.mongo-express.address=:8081"
- "--entrypoints.jaeger.address=:16686"
- "--entrypoints.prometheus.address=:9090"
- "--entrypoints.grafana.address=:3456"
- "--certificatesresolvers.stellarium-tls.acme.dnsChallenge=true"
- "--certificatesresolvers.stellarium-tls.acme.dnsChallenge.provider=cloudflare"
- "--certificatesresolvers.stellarium-tls.acme.email=lothindir@gmail.com"
- "--certificatesresolvers.stellarium-tls.acme.storage=/letsencrypt/acme.json"
- "--certificatesresolvers.stellarium-tls.acme.caServer=https://acme-v02.api.letsencrypt.org/directory" #Remove to use prod server
labels:
- "traefik.enable=true"
- "traefik.http.routers.api.rule=Host(`traefik.${BASE_HOSTNAME}`)"
- "traefik.http.routers.api.service=api@internal"
- "traefik.http.routers.api.entrypoints=websecure"
- "traefik.http.routers.api.tls.certresolver=stellarium-tls"
- "traefik.http.routers.api.tls.domains[0].main=${BASE_HOSTNAME}"
- "traefik.http.routers.api.tls.domains[0].sans=traefik.${BASE_HOSTNAME},defi.${BASE_HOSTNAME}"
- "traefik.http.middlewares.auth.basicauth.users=stellarium:$$2y$$10$$Iwj88jGAUSaQMec0lSRxo.oLlyYReu6n5PGek1dcEuluD.W.VVl06"
environment:
- CLOUDFLARE_EMAIL=${CF_API_EMAIL}
- CLOUDFLARE_API_KEY=${CF_API_KEY}
restart: always
ports:
- 80:80
- 443:443
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- acme-cert:/letsencrypt
networks:
- main-network
jaeger:
image: jaegertracing/all-in-one:1.27
container_name: jaeger
depends_on:
- traefik
labels:
- "traefik.enable=true"
- "traefik.http.routers.jaeger.rule=Host(`${BASE_HOSTNAME}`)"
- "traefik.http.routers.jaeger.entrypoints=jaeger"
ports:
- 5775:5775
- 6831:6831
- 5778:5778
- 16686:16686
- 14268:14268
- 14250:14250
- 9411:9411
prometheus:
image: prom/prometheus
container_name: prometheus
depends_on:
- traefik
labels:
- "traefik.enable=true"
- "traefik.http.routers.prometheus.rule=Host(`${BASE_HOSTNAME}`)"
- "traefik.http.routers.prometheus.entrypoints=prometheus"
grafana:
image: grafana/grafana:latest
container_name: grafana
depends_on:
- traefik
- jaeger
- prometheus
ports:
- 3456:3000
labels:
- "traefik.enable=true"
- "traefik.http.routers.grafana.rule=Host(`${BASE_HOSTNAME}`)"
- "traefik.http.routers.grafana.entrypoints=grafana"
web:
build:
context: ./web
dockerfile: Dockerfile
container_name: web
depends_on:
- traefik
- neo4j
- mongodb
labels:
- "traefik.enable=true"
- "traefik.http.middlewares.web-stripprefix.stripprefix.prefixes=/api"
- "traefik.http.middlewares.web-redirectregex.redirectregex.regex=^http://defi.${BASE_HOSTNAME}/(.*)"
- "traefik.http.middlewares.web-redirectregex.redirectregex.replacement=http://api.${BASE_HOSTNAME}/trial/$${1}"
- "traefik.http.middlewares.web-redirectregex.redirectregex.permanent=true"
- "traefik.http.middlewares.web-redirecthttps.redirectscheme.scheme=https"
- "traefik.http.middlewares.web-redirecthttps.redirectscheme.permanent=true"
# HTTP
- "traefik.http.routers.web.rule=(Host(`${BASE_HOSTNAME}`) && PathPrefix(`/api`)) || Host(`defi.${BASE_HOSTNAME}`)"
#- "traefik.http.routers.web.middlewares=web-redirecthttps"
- "traefik.http.routers.web.middlewares=web-redirectregex,web-stripprefix"
- "traefik.http.routers.web.entrypoints=web"
# HTTPS
- "traefik.http.routers.web-secure.rule=(Host(`${BASE_HOSTNAME}`) && PathPrefix(`/api`)) || Host(`defi.${BASE_HOSTNAME}`)"
- "traefik.http.routers.web-secure.middlewares=web-redirectregex,web-stripprefix"
- "traefik.http.routers.web-secure.entrypoints=websecure"
- "traefik.http.routers.web-secure.tls.certresolver=stellarium-tls"
environment:
- PORT=3333
- HOST=0.0.0.0
- NODE_ENV=production
- APP_NAME=stellarium
- APP_URL=http://0.0.0.0:3333
- APP_KEY=${APP_KEY}
- SESSION_DRIVER=cookie
- NEO4J_HOST=neo4j
- NEO4J_USER=${NEO4J_USER}
- NEO4J_PASSWORD=${NEO4J_PASSWORD}
- MONGO_DB=stellarium
- MONGO_URI=mongodb://mongodb/
- MONGO_USER=${MONGO_USER}
- MONGO_PASSWORD=${MONGO_PASSWORD}
- HASH_SECRET=${HASH_SECRET}
restart: unless-stopped
networks:
- main-network
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: frontend
ports:
- 3000:3000
depends_on:
- traefik
labels:
- "traefik.enable=true"
- "traefik.http.middlewares.frontend-redirecthttps.redirectscheme.scheme=https"
- "traefik.http.middlewares.stellarium-frontend-redirecthttps.redirectscheme.permanent=true"
# HTTP
- "traefik.http.routers.frontend.rule=Host(`${BASE_HOSTNAME}`)"
- "traefik.http.routers.frontend.entrypoints=web"
#- "traefik.http.routers.frontend.middlewares=frontend-redirecthttps"
# HTTPS
- "traefik.http.routers.frontend-secure.rule=Host(`${BASE_HOSTNAME}`)"
- "traefik.http.routers.frontend-secure.entrypoints=websecure"
- "traefik.http.routers.frontend-secure.tls.certresolver=stellarium-tls"
environment:
- NUXT_HOST=0.0.0.0
- NUXT_PORT=3000
- API_URL=${API_URL}
- NODE_ENV=production
restart: unless-stopped
networks:
- main-network
neo4j:
image: neo4j:4.2
container_name: neo4j
restart: unless-stopped
depends_on:
- traefik
ports:
- 7474:7474
- 7473:7473
- 7687:7687
labels:
- "traefik.enable=true"
- "traefik.http.routers.neo4j.rule=Host(`${BASE_HOSTNAME}`)"
- "traefik.http.routers.neo4j.entrypoints=neo4j, neo4j-secure"
- "traefik.tcp.routers.neo4j.rule=HostSNI(`${BASE_HOSTNAME}`)"
- "traefik.tcp.routers.neo4j.entrypoints=bolt"
volumes:
- neo4j-data:/data
- ./neo4j/conf:/conf
- ./neo4j/import:/import
- ./neo4j/logs:/logs
- ./neo4j/plugins:/plugins
environment:
# Raise memory limits
- NEO4J_dbms_memory_pagecache_size=1G
- NEO4J_dbms.memory.heap.initial_size=1G
- NEO4J_dbms_memory_heap_max__size=1G
- NEO4J_dbms.connector.https.enabled=true
networks:
- main-network
mongodb:
image: mongo:latest
restart: unless-stopped
container_name: mongodb
depends_on:
- traefik
volumes:
- mongo-data:/data/db
- ./mongo/init:/docker-entrypoint-initdb.d/
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_ROOT_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_ROOT_PASSWORD}
MONGO_INITDB_DATABASE: stellarium
labels:
- "traefik.enable=true"
- "traefik.tcp.routers.mongo.rule=HostSNI(`${BASE_HOSTNAME}`)"
- "traefik.tcp.routers.mongo.entrypoints=mongo"
networks:
- main-network
mongo-express:
container_name: mongo-express
image: mongo-express
restart: unless-stopped
depends_on:
- traefik
- mongodb
ports:
- 8081:8081
labels:
- "traefik.enable=true"
- "traefik.http.routers.mongo.rule=Host(`${BASE_HOSTNAME}`)"
- "traefik.http.routers.mongo.entrypoints=mongo-express"
environment:
ME_CONFIG_MONGODB_ADMINUSERNAME: ${MONGO_ROOT_USERNAME}
ME_CONFIG_MONGODB_ADMINPASSWORD: ${MONGO_ROOT_PASSWORD}
ME_CONFIG_MONGODB_SERVER: mongodb
networks:
- main-network
networks:
main-network:
driver: bridge
volumes:
acme-cert:
mongo-data:
neo4j-data: