-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
85 lines (78 loc) · 1.93 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
version: "3.9"
services:
db:
image: mysql:8.0.32-debian
container_name: mysql
environment:
- MYSQL_DATABASE=${DB_NAME}
- MYSQL_USER=${DB_USER}
- MYSQL_PASSWORD=${DB_PASSWORD}
- MYSQL_ROOT_PASSWORD=${DB_PASSWORD}
ports:
- "${DB_PORT}:${DB_PORT}"
volumes:
- mysql_data:/var/lib/mysql
networks:
- book-catalog-network
db-test:
image: mysql:8.0.32-debian
container_name: mysql-test
environment:
- MYSQL_DATABASE=${TEST_DB_NAME}
- MYSQL_USER=${DB_USER}
- MYSQL_PASSWORD=${DB_PASSWORD}
- MYSQL_ROOT_PASSWORD=${DB_PASSWORD}
ports:
- "${DB_TEST_PORT}:${DB_PORT}"
networks:
- book-catalog-network
flask:
build:
context: ./
dockerfile: ./dockerfiles/flask/Dockerfile
args:
- DEV=${DEV}
environment:
- DEV=${DEV}
- SECRET_KEY=${SECRET_KEY}
- DB=${DB}
- DB_USER=${DB_USER}
- DB_PASSWORD=${DB_PASSWORD}
- DB_PORT=${DB_PORT}
- DB_TEST_PORT=${DB_TEST_PORT}
- DB_NAME=${DB_NAME}
- TEST_DB_NAME=${TEST_DB_NAME}
- COVERAGE_FILE=${COVERAGE_FILE}
- COVERALLS_REPO_TOKEN=${COVERALLS_REPO_TOKEN}
container_name: flask
ports:
- "5000:5000"
volumes:
- ./app/:/home/app-user/book-catalog/app
- ./tests/:/home/app-user/book-catalog/tests
- coverage:/home/app-user/book-catalog/coverage
command: >
sh -c "./app/wait_for_db.sh && gunicorn --bind=0.0.0.0:5000 'app:create_app()'"
networks:
book-catalog-network:
aliases:
- flask
depends_on:
- db
- db-test
nginx:
image: nginx:1.23.3-alpine-slim
container_name: nginx
volumes:
- ./dockerfiles/nginx/default.conf:/etc/nginx/conf.d/default.conf
ports:
- 80:80
networks:
- book-catalog-network
depends_on:
- flask
volumes:
mysql_data:
coverage:
networks:
book-catalog-network: