-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
47 lines (44 loc) · 1 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
version: "3"
networks:
project_net:
driver: bridge
services:
app:
container_name: project-app
image: project_app:${VERSION}
build:
context: app/
dockerfile: Dockerfile
networks:
- project_net
ports:
- ${APP_PORT}:5000
environment:
- VERSION=${VERSION}
- DB_USER=${DB_USER}
- DB_PASS=${DB_PASS}
- DB_SERVER=project-db
- DB_PORT=3306
- DB_NAME=${DB_NAME}
- SECRET_KEY=${SECRET_KEY}
volumes:
- ./db/:/opt/project/db/
command: /bin/bash -c "
./wait-for-mysql.sh db 3306 &&
./migrate.sh /opt/project/db/migrations/ &&
gunicorn app:app --workers 4 --timeout 120 --bind 0.0.0.0:5000"
depends_on:
- db
db:
container_name: project-db
image: mysql:8.0
networks:
- project_net
ports:
- ${DB_PORT}:3306
environment:
- MYSQL_ROOT_PASSWORD=${DB_PASS}
- MYSQL_DATABASE=${DB_NAME}
- LANG=ko_KR.UTF-8
volumes:
- ./db/data/:/var/lib/mysql