-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker_server.yml
181 lines (173 loc) · 5.83 KB
/
docker_server.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
version: "3"
services:
# flask-api server
hicognition:
container_name: flask-server
volumes:
- ${LOG_DIR}:/logs/
environment:
- FLASK_DEBUG=0
- FLASK_CONFIG=production
- FLASK_APP=/code/hicognition_server.py
- DATABASE_URL=${DATABASE_URL}
- SECRET_KEY=${SECRET_KEY}
- REDIS_URL=${REDIS_URL}
- UPLOAD_DIR=${UPLOAD_DIR}
- CHROM_SIZES=${CHROM_SIZES}
- CHROM_ARMS=${CHROM_ARMS}
- MAIL_SERVER=${MAIL_SERVER}
- MAIL_PORT=${MAIL_PORT}
- MAIL_USERNAME=${MAIL_USERNAME}
- MAIL_PASSWORD=${MAIL_PASSWORD}
- MAIL_DEFAULT_SENDER=${MAIL_DEFAULT_SENDER}
- SECRET_SALT=${SECRET_SALT}
# might not work on my machine, but also not strictly required?
ports:
# only map localhost-port
- "5000:5000"
build:
context: "./back_end/"
image: hicognition:server
entrypoint: "/bin/bash"
command: -c "cd /code && ./boot_prod.sh"
networks:
hicognition-net:
ipv4_address: 172.18.0.3
# nginx server to serve front-end and redirect requests to flask-api
nginx:
container_name: hicognition-nginx
image: hicognition-nginx:server
build:
context: "./"
dockerfile: "./nginx_server/Dockerfile"
ports:
- "80:80"
environment:
- "HICOGNITION_UPSTREAM=flask-server:5000"
# map front-end files
depends_on:
- hicognition
networks:
- hicognition-net
redis-server:
container_name: redis-server
build:
context: "./redis"
networks:
hicognition-net:
ipv4_address: 172.18.0.5
ports:
- 6379:6379
redis-worker-long:
volumes:
- ${DATA_DIR}:/code/temp/
- ${LOG_DIR}:/logs/
environment:
- FLASK_DEBUG=0
- FLASK_APP=/code/hicognition_server.py
- FLASK_CONFIG=production
- SECRET_KEY=${SECRET_KEY}
- DATABASE_URL=${DATABASE_URL}
- REDIS_URL=${REDIS_URL}
- UPLOAD_DIR=${UPLOAD_DIR}
- CHROM_SIZES=${CHROM_SIZES}
- CHROM_ARMS=${CHROM_ARMS}
- MAIL_SERVER=${MAIL_SERVER}
- MAIL_PORT=${MAIL_PORT}
- MAIL_USERNAME=${MAIL_USERNAME}
- MAIL_PASSWORD=${MAIL_PASSWORD}
- MAIL_DEFAULT_SENDER=${MAIL_DEFAULT_SENDER}
- SECRET_SALT=${SECRET_SALT}
depends_on:
- redis-server
build:
context: "./back_end/"
scale: 1
image: hicognition:latest
entrypoint: "/bin/bash"
networks:
- hicognition-net
# sleeps to wait for redis-server. TODO: make this check nicer!
command: -c "sleep 5 && cd /code/ && rq worker -u ${REDIS_URL} hicognition-tasks-long"
redis-worker-medium:
volumes:
- ${DATA_DIR}:/code/temp/
- ${LOG_DIR}:/logs/
environment:
- FLASK_DEBUG=0
- FLASK_APP=/code/hicognition_server.py
- FLASK_CONFIG=production
- SECRET_KEY=${SECRET_KEY}
- DATABASE_URL=${DATABASE_URL}
- REDIS_URL=${REDIS_URL}
- UPLOAD_DIR=${UPLOAD_DIR}
- CHROM_SIZES=${CHROM_SIZES}
- CHROM_ARMS=${CHROM_ARMS}
- MAIL_SERVER=${MAIL_SERVER}
- MAIL_PORT=${MAIL_PORT}
- MAIL_USERNAME=${MAIL_USERNAME}
- MAIL_PASSWORD=${MAIL_PASSWORD}
- MAIL_DEFAULT_SENDER=${MAIL_DEFAULT_SENDER}
- SECRET_SALT=${SECRET_SALT}
depends_on:
- redis-server
build:
context: "./back_end"
scale: 1
image: hicognition:server
entrypoint: "/bin/bash"
networks:
- hicognition-net
# sleeps to wait for redis-server. TODO: make this check nicer!
command: -c "sleep 5 && cd /code/ && rq worker -u ${REDIS_URL} hicognition-tasks-medium"
redis-worker-short:
volumes:
- ${DATA_DIR}:/code/temp/
- ${LOG_DIR}:/logs/
environment:
- FLASK_DEBUG=0
- FLASK_APP=/code/hicognition_server.py
- FLASK_CONFIG=production
- SECRET_KEY=${SECRET_KEY}
- DATABASE_URL=${DATABASE_URL}
- REDIS_URL=${REDIS_URL}
- UPLOAD_DIR=${UPLOAD_DIR}
- CHROM_SIZES=${CHROM_SIZES}
- CHROM_ARMS=${CHROM_ARMS}
- MAIL_SERVER=${MAIL_SERVER}
- MAIL_PORT=${MAIL_PORT}
- MAIL_USERNAME=${MAIL_USERNAME}
- MAIL_PASSWORD=${MAIL_PASSWORD}
- MAIL_DEFAULT_SENDER=${MAIL_DEFAULT_SENDER}
- SECRET_SALT=${SECRET_SALT}
depends_on:
- redis-server
build:
context: "./back_end/"
scale: 1
image: hicognition:server
entrypoint: "/bin/bash"
networks:
- hicognition-net
# sleeps to wait for redis-server. TODO: make this check nicer!
command: -c "sleep 5 && cd /code/ && rq worker -u ${REDIS_URL} hicognition-tasks-short"
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
networks:
hicognition-net:
ipv4_address: 172.18.0.9
networks:
hicognition-net:
ipam:
driver: default
config:
- subnet: 172.18.0.0/16