-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yaml
55 lines (55 loc) · 1.55 KB
/
docker-compose.yaml
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
version: '3.1'
services:
flask_app:
container_name: flask_app
restart: always
build:
context: .
dockerfile: Dockerfile-Flask
depends_on:
- db
environment:
- PYTHONBUFFERED=1
- ENVVAR_PREFIX_FOR_DYNACONF=flask_app
- ENVVAR_FOR_DYNACONF=settings.toml
- FLASK_APP=run.py
- FLASK_RUN_HOST=0.0.0.0
- FLASK_DEBUG=0
networks:
flask_network:
aliases:
- flask-network
command: bash -c 'flask create_db && gunicorn --bind 0.0.0.0:8000 --workers 4 "run:create_run()"'
nginx:
image: nginx
container_name: flask_nginx
restart: always
volumes:
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
ports:
- 80:80
depends_on:
- flask_app
networks:
- flask_network
db:
image: mysql:5.7
restart: always
container_name: flask_db
ports:
- "3307:3306"
expose:
- "3307"
environment:
- MYSQL_USER=user
- MYSQL_PASSWORD=user123
- MYSQL_DATABASE=flask_api
- MYSQL_ROOT_PASSWORD=12345678
volumes:
- flask_volume:/var/lib/mysql
networks:
- flask_network
volumes:
flask_volume:
networks:
flask_network: