-
Notifications
You must be signed in to change notification settings - Fork 9
/
docker-compose.yml
107 lines (102 loc) · 2.99 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
version: '3'
services:
worker:
restart: on-failure
image: ${DOCKER_REPO}/faceanalysis_app:${BUILD_TAG}
build:
context: ./app
args:
DEVTOOLS: ${DEVTOOLS}
command: ["python3", "main.py", "worker"]
depends_on:
- mysql
- rabbitmq
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "5"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- "${DATA_DIR}:/app/faceanalysis/images"
environment:
HOST_DATA_DIR: "${DATA_DIR}"
MOUNTED_DATA_DIR: /app/faceanalysis/images
LOGGING_LEVEL: ${LOGGING_LEVEL}
ALLOWED_IMAGE_MIMETYPES: ${ALLOWED_IMAGE_MIMETYPES}
IMAGE_PROCESSOR_QUEUE: ${IMAGE_PROCESSOR_QUEUE}
DOCKER_DAEMON: ${DOCKER_DAEMON}
RABBITMQ_HOST: rabbitmq
RABBITMQ_USER: ${RABBITMQ_USER}
RABBITMQ_PASSWORD: ${RABBITMQ_PASSWORD}
MYSQL_HOST: mysql
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
DISTANCE_SCORE_THRESHOLD: ${DISTANCE_SCORE_THRESHOLD}
FACE_VECTORIZE_ALGORITHM: ${FACE_VECTORIZE_ALGORITHM}
api:
restart: always
image: ${DOCKER_REPO}/faceanalysis_app:${BUILD_TAG}
build:
context: ./app
args:
DEVTOOLS: ${DEVTOOLS}
depends_on:
- worker
- mysql
- rabbitmq
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "5"
volumes:
- "${DATA_DIR}:/app/faceanalysis/images"
environment:
LOGGING_LEVEL: ${LOGGING_LEVEL}
ALLOWED_IMAGE_MIMETYPES: ${ALLOWED_IMAGE_MIMETYPES}
IMAGE_PROCESSOR_QUEUE: ${IMAGE_PROCESSOR_QUEUE}
RABBITMQ_HOST: rabbitmq
RABBITMQ_USER: ${RABBITMQ_USER}
RABBITMQ_PASSWORD: ${RABBITMQ_PASSWORD}
MYSQL_HOST: mysql
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
FACE_VECTORIZE_ALGORITHM: ${FACE_VECTORIZE_ALGORITHM}
FACE_API_ACCESS_KEY: ${FACE_API_ACCESS_KEY}
FACE_API_MODEL_ID: ${FACE_API_MODEL_ID}
FACE_API_ENDPOINT: ${FACE_API_ENDPOINT}
FACE_API_REGION: ${FACE_API_REGION}
TOKEN_SECRET_KEY: ${TOKEN_SECRET_KEY}
DEFAULT_TOKEN_EXPIRATION_SECS: ${DEFAULT_TOKEN_EXPIRATION_SECS}
ports:
- "${APP_PORT}:5000"
rabbitmq:
restart: always
image: rabbitmq:3.7.7-management
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "5"
environment:
RABBITMQ_DEFAULT_USER: ${RABBITMQ_USER}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASSWORD}
mysql:
restart: always
image: ${DOCKER_REPO}/faceanalysis_mysql:${BUILD_TAG}
build: ./mysql
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "5"
volumes:
- "${DB_DIR}:/var/lib/mysql"
environment:
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}