-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker_integration_tests.yml
181 lines (170 loc) · 5.39 KB
/
docker_integration_tests.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:
- ${HICOGNITION_DIR}:/code
- ${LOG_DIR}:/logs/
environment:
- FLASK_DEBUG=0
- FLASK_APP=/code/hicognition_server.py
- DATABASE_URL=${DATABASE_URL}
- REDIS_URL=${REDIS_URL}
- UPLOAD_DIR=${UPLOAD_DIR}
- CHROM_SIZES=${CHROM_SIZES}
- CHROM_ARMS=${CHROM_ARMS}
- FLASK_CONFIG=end2end
ports:
# only map localhost-port
- "5000:5000"
build:
context: "./back_end"
image: hicognition:latest
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
build:
context: "./nginx"
ports:
- "80:80"
# map front-end files
depends_on:
- node
- hicognition
volumes:
- ${DIR_FRONT_END}:/front_end
- ${DIR_STATIC}:/static
- ${KEY_DIR}:/keys
networks:
- hicognition-net
# container to build front-end
node:
container_name: node-builder
image: node:14-buster
volumes:
- ${DIR_FRONT_END}:/front_end
entrypoint:
- "/bin/bash"
command: -c "cd /front_end; [ -e ./dist/static/finished.json ] && rm ./dist/static/finished.json; npm install && npm run build && touch ./dist/static/finished.json"
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:
- ${HICOGNITION_DIR}:/code
- ${LOG_DIR}:/logs/
environment:
- FLASK_DEBUG=1
- FLASK_APP=/code/hicognition_server.py
- DATABASE_URL=${DATABASE_URL}
- REDIS_URL=${REDIS_URL}
- UPLOAD_DIR=${UPLOAD_DIR}
- CHROM_SIZES=${CHROM_SIZES}
- CHROM_ARMS=${CHROM_ARMS}
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:
- ${HICOGNITION_DIR}:/code
- ${LOG_DIR}:/logs/
environment:
- FLASK_DEBUG=1
- FLASK_APP=/code/hicognition_server.py
- DATABASE_URL=${DATABASE_URL}
- REDIS_URL=${REDIS_URL}
- UPLOAD_DIR=${UPLOAD_DIR}
- CHROM_SIZES=${CHROM_SIZES}
- CHROM_ARMS=${CHROM_ARMS}
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-medium"
redis-worker-short:
volumes:
- ${HICOGNITION_DIR}:/code
- ${LOG_DIR}:/logs/
environment:
- FLASK_DEBUG=1
- FLASK_APP=/code/hicognition_server.py
- DATABASE_URL=${DATABASE_URL}
- REDIS_URL=${REDIS_URL}
- UPLOAD_DIR=${UPLOAD_DIR}
- CHROM_SIZES=${CHROM_SIZES}
- CHROM_ARMS=${CHROM_ARMS}
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-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
volumes:
- ./mysql/mysql.cnf:/etc/my.cnf
networks:
hicognition-net:
ipv4_address: 172.18.0.9
# Cypress container
cypress:
container_name: cypress
build:
context: "./front_end/e2e"
environment:
# pass base url to test pointing at the web application
- CYPRESS_baseUrl=http://nginx
# share the current folder as volume to avoid copying
working_dir: /e2e
volumes:
- ${INTEGRATION_TESTS}:/e2e
networks:
hicognition-net:
ipv4_address: 172.18.0.10
command: -c "sleep 10000"
networks:
hicognition-net:
ipam:
driver: default
config:
- subnet: 172.18.0.0/16