-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker_demo.yml
53 lines (49 loc) · 1.57 KB
/
docker_demo.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
version: "3.9"
services:
# flask-api server
hicognition:
container_name: flask-server
volumes:
- ${LOG_DIR}:/logs/
environment:
- FLASK_DEBUG=1
- FLASK_APP=/code/hicognition_server.py
- DATABASE_URL=mysql+pymysql://hicognition:${MYSQL_PASSWORD}@mysql/hicognition
- SHOWCASE=1
- LOG_FILE_NAME=/logs/dev_application.logs
- ERROR_LOG_FILE_NAME=/logs/dev_error.logs
# might not work on my machine, but also not strictly required?
ports:
# only map localhost-port
- "5000:5000"
build:
context: "."
dockerfile: "./back_end/Dockerfile_showcase"
image: hicognition:demo
depends_on:
- mysql
# nginx server to serve front-end and redirect requests to flask-api
nginx:
container_name: hicognition-nginx
image: hicognition-nginx:demo
build:
context: "./"
dockerfile: "./nginx_demo/Dockerfile"
ports:
- "80:80"
environment:
- "HICOGNITION_UPSTREAM=flask-server:5000"
# map front-end files
depends_on:
- hicognition
mysql:
container_name: mysql
ports:
# map port out for diagnostics
- "3306:3306"
environment:
- MYSQL_RANDOM_ROOT_PASSWORD=yes
- MYSQL_DATABASE=hicognition
- MYSQL_USER=hicognition
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
image: mysql/mysql-server:8.0