-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
54 lines (50 loc) · 1.18 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
services:
app:
build: .
ports:
- "5000:5000"
environment:
- MYSQL_HOST=db
- MYSQL_USER=weather_user
- MYSQL_PASSWORD=weather_pass
- MYSQL_DATABASE=weather_db
- OPENWEATHERMAP_API_KEY=${OPENWEATHERMAP_API_KEY}
- FLASK_ENV=production
- TESTING=false
depends_on:
- db
test:
build: .
environment:
- TESTING=true
- MYSQL_HOST=test-db
- MYSQL_USER=test_user
- MYSQL_PASSWORD=test_pass
- MYSQL_DATABASE=test_db
- OPENWEATHERMAP_API_KEY=test_key
command: pytest -v --cov=.
depends_on:
- test-db
db:
image: mysql:latest
environment:
- MYSQL_ROOT_PASSWORD=root_password
- MYSQL_USER=weather_user
- MYSQL_PASSWORD=weather_pass
- MYSQL_DATABASE=weather_db
volumes:
- weather_data:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "db"]
interval: 10s
timeout: 5s
retries: 5
test-db:
image: mysql:latest
environment:
- MYSQL_ROOT_PASSWORD=test_root_password
- MYSQL_USER=test_user
- MYSQL_PASSWORD=test_pass
- MYSQL_DATABASE=test_db
volumes:
weather_data: