-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
49 lines (45 loc) · 1011 Bytes
/
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
version: '3.9'
services:
web:
build: .
ports:
- "3000:3000"
depends_on:
- db
environment:
- DB_HOST=db
- DB_PASSWORD=password
- DB_NAME=todolist
- DB_USER=root
healthcheck:
test: >
/bin/sh -c "
curl -s http://localhost:3000/api/health | jq '.status == 200 and .message == \"App is running\"' | grep true || exit 1
"
interval: 10s
timeout: 5s
retries: 50
db:
image: mysql
environment:
MYSQL_USER: 'user'
MYSQL_PASSWORD: 'password'
MYSQL_ROOT_PASSWORD: 'password'
MYSQL_DATABASE: todolist
ports:
- "3307:3306"
volumes:
- db-data:/var/lib/mysql
- ./init-db:/docker-entrypoint-initdb.d
logger:
image: curlimages/curl
depends_on:
web:
condition: service_healthy
command: >
/bin/sh -c "
echo 'http://localhost:3000 is now healthy and ready to use!';
exit 0;
"
volumes:
db-data: