-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
230 lines (199 loc) · 5.4 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
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
services:
# § E. Redis
bot_app_redis:
container_name: wpm-discord-bot-app-redis
image: docker.dragonflydb.io/dragonflydb/dragonfly:v1.19.0
restart: always
ulimits:
memlock: -1
ports:
- '127.0.0.1:6379:${BOT_APP_REDIS_PORT}'
volumes:
- redis-data:/data
networks:
- bot_app_shared_network
healthcheck:
start_period: 10s
interval: 5s
timeout: 5s
retries: 7
test: ['CMD', 'redis-cli', 'ping']
# § D. Jaeger
jaeger:
container_name: jaeger
image: jaegertracing/all-in-one:1.58
restart: always
environment:
COLLECTOR_OTLP_ENABLED: 'true'
ports:
- 127.0.0.1:16686:16686
- 127.0.0.1:4318:4318
networks:
- bot_app_shared_network
# § C. Dozzle
dozzle:
container_name: wpm-discord-bot-dozzle
image: amir20/dozzle:v7.0.7
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./docker/dozzle/data:/data
ports:
- 49152:8080
environment:
DOZZLE_AUTH_PROVIDER: simple
# § B. NextCloud
# B. 1. App - NextCloud
nextcloud_app:
container_name: wpm-discord-bot-nextcloud-app
image: nextcloud
restart: always
ports:
- 49153:80
links:
- nextcloud_db
volumes:
- nextcloud:/var/www/html
- bot_app_and_nextcloud_shared_traces:/mnt/discord-bot-traces
environment:
MYSQL_PASSWORD: ${NEXTCLOUD_MYSQL_PASSWORD}
MYSQL_DATABASE: ${NEXTCLOUD_MYSQL_DATABASE}
MYSQL_USER: ${NEXTCLOUD_MYSQL_USER}
MYSQL_HOST: nextcloud_db
depends_on:
nextcloud_db:
condition: service_healthy
# B. 2. MariaDB - NextCloud
nextcloud_db:
container_name: wpm-discord-bot-nextcloud-db
image: mariadb:10.6
restart: always
command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
volumes:
- nextcloud_db:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: ${NEXTCLOUD_MYSQL_ROOT_PASSWORD}
MYSQL_PASSWORD: ${NEXTCLOUD_MYSQL_PASSWORD}
MYSQL_DATABASE: ${NEXTCLOUD_MYSQL_DATABASE}
MYSQL_USER: ${NEXTCLOUD_MYSQL_USER}
# * ... https://mariadb.com/kb/en/using-healthcheck-sh/
healthcheck:
start_period: 10s
interval: 5s
timeout: 5s
retries: 7
test: ['CMD', 'healthcheck.sh', '--su-mysql', '--connect', '--innodb_initialized']
# § A. Bot App
# A. 1. Bun - Bot App
bot_app:
container_name: wpm-discord-bot-app
build:
context: .
dockerfile: Dockerfile.bot-app
restart: always
environment:
BOT_TOKEN: ${BOT_TOKEN}
CLIENT_ID: ${CLIENT_ID}
DEV_GUILD_ID: ${DEV_GUILD_ID}
BOT_APP_DATABASE_URL: ${BOT_APP_DATABASE_URL}
ports:
- '3000:3000'
volumes:
- bot_app_and_nextcloud_shared_traces:/bot-app/traces
networks:
- bot_app_shared_network
depends_on:
bot_app_db:
condition: service_healthy
bot_app_redis:
condition: service_healthy
jaeger:
condition: service_started
develop:
watch:
- action: sync+restart
path: ./src
target: /bot-app/src
ignore:
- .env
- .env.test
- action: sync+restart
path: ./packages
target: /bot-app/packages
ignore:
- .env
- .env.test
- action: rebuild
path: ./prisma/schema.prisma
- action: rebuild
path: ./docker-compose.yml
- action: rebuild
path: ./Dockerfile.bot-app
- action: rebuild
path: ./Makefile
- action: rebuild
path: ./docker/utils/cron.sh
- action: rebuild
path: ./pm2.config.cjs
- action: rebuild
path: ./package.json
- action: rebuild
path: ./packages/shared-lib/package.json
- action: rebuild
path: ./packages/shared-specs/package.json
- action: rebuild
path: ./packages/shared-types/package.json
# A. 2. PG Admin - Bot App
bot_app_pgadmin:
container_name: wpm-discord-bot-app-pgadmin
image: dpage/pgadmin4:latest
restart: always
environment:
PGADMIN_DEFAULT_EMAIL: ${BOT_APP_PGADMIN_DEFAULT_EMAIL}
PGADMIN_DEFAULT_PASSWORD: ${BOT_APP_PGADMIN_DEFAULT_PASSWORD}
ports:
- '49154:80'
networks:
- bot_app_shared_network
depends_on:
bot_app_db:
condition: service_healthy
# A. 3. Postgres (TEST DB) - Bot App
# ... NOT USED YET
# A. 4. Postgres - Bot App
bot_app_db:
container_name: wpm-discord-bot-app-db
image: postgres:16.3
restart: always
environment:
POSTGRES_USER: ${BOT_APP_POSTGRES_USER}
PGUSER: ${BOT_APP_POSTGRES_USER}
POSTGRES_PASSWORD: ${BOT_APP_POSTGRES_PASSWORD}
POSTGRES_DB: ${BOT_APP_POSTGRES_DB}
ports:
- '127.0.0.1:5432:5432'
volumes:
- bot_app_pg_data:/var/lib/postgresql/data
networks:
- bot_app_shared_network
healthcheck:
test: ['CMD-SHELL', 'pg_isready -d ${BOT_APP_POSTGRES_DB} -U ${BOT_APP_POSTGRES_USER}']
start_period: 10s
interval: 5s
timeout: 5s
retries: 7
volumes:
redis-data:
bot_app_pg_data:
test_bot_app_pg_data:
nextcloud:
nextcloud_db:
bot_app_and_nextcloud_shared_traces:
driver: local
driver_opts:
type: none
o: bind
device: ./traces
networks:
bot_app_shared_network:
driver: bridge