-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
47 lines (46 loc) · 1.06 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
version: "3.3"
services:
scrapper:
build: ./scrapper
depends_on:
- db_scrapper
env_file: ./scrapper/.env
ports:
- "4040:4040"
restart: on-failure
api:
build: ./api
depends_on:
- db_api
env_file: ./api/.env
restart: on-failure
ports:
- "8282:8282"
db_scrapper:
image: mysql:5.7
ports:
- "3307:3306"
volumes:
- scrapper-data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: scrapper
MYSQL_USER: test
MYSQL_PASSWORD: test
db_api:
image: mysql:5.7
ports:
- "3308:3306"
volumes:
- api-data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: api
MYSQL_USER: test
MYSQL_PASSWORD: test
volumes:
scrapper-data:
api-data:
# scrapper service will fail at the begining until DB is ready to accept connections.
# Event though scrapper depends on DB that means on running container not on mysql ready for connections.
# So restart scrapper service on failure