-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
124 lines (107 loc) · 2.87 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
version: "3.2"
services:
frog:
hostname: proycon/lamachine
image: proycon/lamachine:latest
command: bash -c "frog -S 12345 --skip p"
deploy:
replicas: 1
restart_policy:
condition: on-failure
delay: 10s
max_attempts: 3
resources:
limits:
cpus: ${FROG_CPU_LIMIT}
redis:
hostname: redis
image: redis:latest
deploy:
replicas: 1
restart_policy:
condition: on-failure
delay: 10s
max_attempts: 3
database:
hostname: mongo
image: mongo:latest
volumes:
- ${DATA_DIRECTORY}:/data/db
worker: &worker-base
image: newsgac/newsgac
depends_on:
- redis
- database
hostname: celeryworker
volumes:
- ./newsgac:/newsgac/newsgac
environment:
- FLASK_ENV
- FLASK_SECRET_KEY
- MONGO_HOST
- MONGO_PORT
- MONGO_DB_NAME
- FROG_HOSTNAME
- FROG_PORT
- REDIS_HOST
- REDIS_PORT
- N_PARALLEL_JOBS
- N_CROSS_VAL_JOBS
deploy:
replicas: 1
restart_policy:
condition: on-failure
delay: 10s
max_attempts: 3
resources:
limits:
cpus: ${CELERY_CPU_LIMIT}
frogworker:
<<: *worker-base
image: newsgac/newsgac
hostname: frogworker
deploy:
replicas: 1
restart_policy:
condition: on-failure
delay: 10s
max_attempts: 3
depends_on:
- redis
- database
- frog
command: ["sh", "-c", "celery -A newsgac.tasks.celery_app worker -l warning --concurrency 1 -n frogworker@%h -Q frog"]
web:
image: newsgac/newsgac
depends_on:
- worker
- redis
- database
- frog
command: ["python", "newsgac/app.py"]
volumes:
- ./newsgac:/newsgac/newsgac
environment:
- PYTHONPATH=/newsgac
- FLASK_SECRET_KEY
- FLASK_ENV
- FLASK_DEBUG
- FLASK_APP
- MONGO_HOST
- MONGO_PORT
- MONGO_USER
- MONGO_PASSWORD
- MONGO_DB_NAME
- FROG_HOSTNAME
- FROG_PORT
- REDIS_HOST
- REDIS_PORT
- CELERY_EAGER
- N_PARALLEL_JOBS
- N_CROSS_VAL_JOBS
deploy:
replicas: 1
restart_policy:
condition: on-failure
delay: 10s
max_attempts: 3