-
Notifications
You must be signed in to change notification settings - Fork 9
/
docker-compose.yml
106 lines (100 loc) · 2.39 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
services:
postgres:
restart: always
image: postgis/postgis:12-3.0
environment:
POSTGRES_DB: ${DATABASE_NAME:-apollo}
POSTGRES_USER: ${DATABASE_USERNAME:-postgres}
PGUSER: ${DATABASE_USERNAME:-postgres}
POSTGRES_HOST_AUTH_METHOD: trust
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 2s
timeout: 5s
retries: 5
start_period: 5s
start_interval: 1s
redis:
restart: always
image: redis:7
migration:
restart: no
build:
context: .
target: ${ENV:-production}
depends_on:
redis:
condition: service_started
postgres:
condition: service_healthy
links:
- postgres
- redis
environment:
DATABASE_NAME: ${DATABASE_NAME:-apollo}
FLASK_ENV: ${ENV:-production}
FLASK_APP: apollo.runner
env_file:
- ./.env
command: ['flask', 'db', 'upgrade']
web-blue: &web
restart: always
build:
context: .
target: ${ENV:-production}
depends_on:
redis:
condition: service_started
postgres:
condition: service_healthy
restart: true
migration:
condition: service_completed_successfully
links:
- postgres
- redis
environment:
DATABASE_NAME: ${DATABASE_NAME:-apollo}
FLASK_ENV: ${ENV:-production}
FLASK_APP: apollo.runner
env_file:
- ./.env
volumes:
- upload_data:/app/uploads
ports:
- "5000:5000"
command: ['gunicorn', '-c', 'gunicorn.py', 'apollo.runner']
web-green:
<<: *web
ports:
- "5001:5000"
worker:
restart: always
build:
context: .
target: ${ENV:-production}
depends_on:
redis:
condition: service_started
postgres:
condition: service_healthy
restart: true
migration:
condition: service_completed_successfully
links:
- postgres
- redis
environment:
DATABASE_NAME: ${DATABASE_NAME:-apollo}
FLASK_ENV: ${ENV:-production}
FLASK_APP: apollo.runner
env_file:
- ./.env
volumes:
- upload_data:/app/uploads
command: ['celery', '--app=apollo.runner', 'worker', '--beat', '--loglevel=WARNING', '--concurrency=2', '--without-gossip', '--without-mingle', '--optimization=fair']
volumes:
postgres_data:
upload_data: