-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdocker-compose.yml
64 lines (60 loc) · 1.26 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
version: '3'
services:
mysql:
container_name: todo-list-mysql
platform: linux/amd64
image: mysql:5
environment:
MYSQL_ROOT_PASSWORD: "root"
ports:
- 3306:3306
healthcheck:
test: [ "CMD", "mysqladmin", "ping", "-h", "localhost", "-proot" ]
timeout: 10s
retries: 10
start_period: 10s
networks:
- todo-list
backend:
container_name: todo-list-backend
build: ./backend
ports:
- 3001:3001
depends_on:
mysql:
condition: service_healthy
environment:
API_PORT: 3001
DB_USER: "root"
DB_PASS: "root"
DB_NAME: "todos"
DB_HOST: "mysql"
DB_PORT: 3306
DB_DIALECT: "mysql"
DB_OPTIONS: "{}"
healthcheck:
test: [ "CMD", "curl", "http://localhost:3001/health" ]
timeout: 10s
retries: 10
networks:
- todo-list
command: bash -c "
npm i sequelize-cli &&
npm run db &&
npm start
"
frontend:
container_name: todo-list-frontend
build: ./frontend
depends_on:
backend:
condition: service_healthy
environment:
API_URI: "http://localhost:3001"
ports:
- 3000:80
networks:
- todo-list
networks:
todo-list:
name: todo-list