forked from oss-aspen/8Knot
-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
100 lines (93 loc) · 2.65 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
services:
reverse-proxy:
image: nginx:latest
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- app-server
ports:
- "8080:8080" # bound to host port, exposed app endpoint
app-server:
build:
context: .
dockerfile: ./docker/Dockerfile
command:
[ "gunicorn", "--bind", ":8080", "app:server", "--workers", "1", "--threads", "2" ]
# ports:
# - 8080:8080
depends_on:
- worker-callback
- worker-query
- redis-cache
- redis-users
env_file:
- ./env.list
restart: always
worker-callback:
build:
context: .
dockerfile: ./docker/Dockerfile
command:
[ "celery", "-A", "app:celery_app", "worker", "--loglevel=INFO" ]
depends_on:
- redis-cache
- redis-users
env_file:
- ./env.list
restart: always
worker-query:
build:
context: .
dockerfile: ./docker/Dockerfile
command:
[ "celery", "-A", "app:celery_app", "worker", "--loglevel=INFO", "-Q", "data" ]
depends_on:
- redis-cache
env_file:
- ./env.list
restart: always
# for data blob caching
redis-cache:
image: docker.io/library/redis:6
command:
- /bin/sh
- -c
# - Double dollars, so that the variable is not expanded by Docker Compose
# - Surround by quotes, so that the shell does not split the password
# - The ${variable:?message} syntax causes shell to exit with a non-zero
# code and print a message, when the variable is not set or empty
- redis-server --requirepass "$${REDIS_PASSWORD:?REDIS_PASSWORD variable is not set}"
env_file:
- ./env.list
restart: always
# for user session storage
redis-users:
image: docker.io/library/redis:6
command:
- /bin/sh
- -c
# - Double dollars, so that the variable is not expanded by Docker Compose
# - Surround by quotes, so that the shell does not split the password
# - The ${variable:?message} syntax causes shell to exit with a non-zero
# code and print a message, when the variable is not set or empty
- redis-server --requirepass "$${REDIS_PASSWORD:?REDIS_PASSWORD variable is not set}"
env_file:
- ./env.list
restart: always
# flower:
# build:
# context: .
# dockerfile: ./docker/Dockerfile
# command:
# [ "celery", "-A", "app:celery_app", "flower" ]
# depends_on:
# - worker-callback
# - worker-query
# - redis-cache
# - app-server
# env_file:
# - ./env.list
# ports:
# - 5555:5555
# profiles:
# - monitoring # run w/ '--profile monitoring' flag to enable