-
Notifications
You must be signed in to change notification settings - Fork 9
/
docker-compose.prod.yaml
109 lines (101 loc) · 2.42 KB
/
docker-compose.prod.yaml
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
version: '3.7'
services:
db:
image: postgres:latest
networks:
- backend
restart: always
volumes:
- type: volume
source: telemetry-data
target: /var/lib/postgresql/data/pgdata
env_file:
- ./services/production.env
environment:
PGDATA: /var/lib/postgresql/data/pgdata
POSTGRES_DB: telemetry
nginx:
image: telemetry/proxy:1.0
networks:
- frontend
restart: always
build:
context: ..
dockerfile: ./deployments/services/nginx/Dockerfile
volumes:
- "telemetry-socket-volume:/var/run/uwsgi/"
- "telemetry-nginx-logs:/var/log/nginx"
ports:
- 80:80
- 443:443
redis:
image: redis:latest
networks:
- backend
restart: always
env_file:
- ./services/production.env
collector:
image: telemetry/collector:1.0
networks:
- backend
volumes:
- "telemetry-socket-volume:/var/www/collector/socket"
- "telemetry-uwsgi-logs:/var/www/collector/log"
restart: always
build:
context: ..
dockerfile: ./deployments/services/collector/Dockerfile
env_file:
- services/production.env
depends_on: ["db", "redis"]
command: uwsgi --ini /var/www/collector/collector.ini
webapp:
image: telemetry/webapp:1.0
networks:
- backend
volumes:
- "telemetry-socket-volume:/var/www/webapp/socket"
- "telemetry-uwsgi-logs:/var/www/webapp/log"
restart: always
build:
context: ..
dockerfile: ./deployments/services/webapp/Dockerfile
env_file:
- ./services/production.env
depends_on: ["db", "redis"]
command: uwsgi --ini /var/www/webapp/webapp.ini
process:
image: telemetry/process:1.0
networks:
- backend
build:
context: ..
dockerfile: ./deployments/services/processing/Dockerfile
env_file:
- ./services/production.env
depends_on: ["db", "migrate"]
command: /srv/processing/run.sh
migrate:
image: telemetry/webapp:1.0
networks:
- backend
env_file:
- ./services/production.env
environment:
FLASK_APP: /var/www/webapp/run.py
working_dir: /var/www/webapp
depends_on: ["db"]
restart: on-failure
command: flask db upgrade
volumes:
telemetry-socket-volume:
telemetry-uwsgi-logs:
telemetry-nginx-logs:
telemetry-data:
networks:
frontend:
driver: bridge
backend:
driver: overlay
internal: true