-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
33 lines (32 loc) · 1008 Bytes
/
docker-compose.yml
File metadata and controls
33 lines (32 loc) · 1008 Bytes
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
services:
db:
image: mysql
command: --secure-file-priv=/docker-entrypoint-initdb.d
restart: always
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: us-city-pops
MYSQL_USER: ${MYSQL_USERNAME}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
volumes:
- ./schema.sql:/docker-entrypoint-initdb.d/schema.sql
- ./us-cities-top-1k-multi-year-sample.csv:/docker-entrypoint-initdb.d/cities.csv
healthcheck:
test: [ "CMD-SHELL", "mysql -u$$MYSQL_USER -p$$MYSQL_PASSWORD -e 'SELECT * FROM city_populations_by_year' us-city-pops" ]
interval: 5s
timeout: 5s
retries: 6
start_period: 15s
us-city-pops:
build: .
depends_on:
db:
condition: service_healthy
required: true
environment:
- DEBUG=${DEBUG}
- MYSQL_HOST=${MYSQL_HOST}
- MYSQL_USERNAME=${MYSQL_USERNAME}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- STATES=${STATES}
entrypoint: ["/app/entrypoint.sh"]