-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose_gcd.yml
65 lines (61 loc) · 1.79 KB
/
docker-compose_gcd.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
version: '3'
services:
mysql:
image: gcd-mysql:${GCD_DUMP_DATE_CURR}
container_name: gcd-mysql
build:
context: .
dockerfile: gcd/mysql/Dockerfile
restart: unless-stopped
ports:
- "3306:3306"
healthcheck:
# Custom healthcheck using file created by ./gcd/mysql/init.sh
# 2 hours for healthcheck, as database import is long
test: bash -c "[ -f /var/lib/mysql/healthy ]"
interval: 30s
retries: 240
environment:
- MYSQL_HOST=localhost
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_DATABASE=gcd
- MYSQL_PORT=${MYSQL_PORT}
- GCD_DUMP_DATE_CURR=${GCD_DUMP_DATE_CURR}
volumes:
# MySQL data volume for persistence
- ./data/volumes/gcd_mysql_${GCD_DUMP_DATE_CURR}:/var/lib/mysql
# MySQL init script to create databases and insert data
- ./gcd/mysql/init.sh:/docker-entrypoint-initdb.d/init.sh
# Read only volume of database dump files
- ./data/gcd:/data/gcd:ro
networks:
- backend
python:
image: gcd-python:${GCD_DUMP_DATE_CURR}
container_name: gcd-python
build:
context: .
dockerfile: gcd/python/Dockerfile
depends_on:
mysql:
condition: service_healthy
restart: unless-stopped
environment:
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_DATABASE=gcd
- MYSQL_PORT=${MYSQL_PORT}
- GCD_DUMP_DATE_LAST=${GCD_DUMP_DATE_LAST}
- GCD_DUMP_DATE_CURR=${GCD_DUMP_DATE_CURR}
- GCD_FULL_MIGRATION=${GCD_FULL_MIGRATION}
- GCD_PARTIAL_MIGRATION=${GCD_PARTIAL_MIGRATION}
volumes:
- ./python:/python
networks:
- frontend
- backend
networks:
frontend:
backend: