forked from WikiEducationFoundation/WikiEduDashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
60 lines (59 loc) · 1.35 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
x-wiki-dashboard-common:
&wiki-dashboard-common
image: wiki-edu-dashboard
build: .
environment:
REDIS_URL: redis://redis:6379
# MYSQL credential must be same as the create-db.sql
MYSQL_USER: wiki
MYSQL_PASSWORD: wikiedu
MYSQL_HOST: mysql
MYSQL_PORT: 3306
depends_on:
&wiki-dashboard-common-depends-on
mysql:
condition: service_healthy
redis:
condition: service_healthy
services:
mysql:
image: mysql:8
restart: always
environment:
MYSQL_RANDOM_ROOT_PASSWORD: yes
volumes:
- ./docker/init-db.sql:/docker-entrypoint-initdb.d/init-db.sql
- mysql_data:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
interval: 5s
timeout: 30s
retries: 5
redis:
image: redis:latest
restart: always
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 30s
retries: 5
init:
<<: *wiki-dashboard-common
command: init
depends_on:
<<: *wiki-dashboard-common-depends-on
app:
<<: *wiki-dashboard-common
command: start
volumes:
- ./:/app
- /app/node_modules
ports:
- 3000:3000
- 8080:8080
depends_on:
<<: *wiki-dashboard-common-depends-on
init:
condition: service_completed_successfully
volumes:
mysql_data: