-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yml
165 lines (146 loc) · 3.89 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
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
version: "3.7"
services:
pubsub:
image: rabbitmq:3-management
container_name: kenza_rabbitmq
restart: unless-stopped
ports:
- 5672:5672
- 15672:15672
labels:
NAME: rabbitmq
volumes:
- ${RABBITMQ_DATA_VOLUME}:/var/lib/rabbitmq
networks:
- pubsub
healthcheck:
test: [ "CMD", "rabbitmqctl", "status" ]
interval: 60s
timeout: 30s
db:
image: postgres
container_name: kenza_postgres
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
ports:
- 5432:5432
volumes:
- ${POSTGRES_DATA_VOLUME}:/var/lib/postgresql/data
networks:
- db
worker:
init: true
restart: unless-stopped
image: ${KENZA_CONTAINER_REGISTRY}/worker:${KENZA_VERSION}
command: |
/kenza/worker -logfile_dir=$KENZA_JOB_LOGS_CONTAINER_PATH
build:
context: .
dockerfile: worker/Dockerfile
args:
- APP_VERSION=$KENZA_VERSION
networks:
- pubsub
depends_on:
- api
- pubsub
volumes:
- ./api_key.secret:/run/secrets/api_key
- /var/run/docker.sock:/var/run/docker.sock # use host's docker
- ${KENZA_JOB_LOGS_HOST_PATH}:${KENZA_JOB_LOGS_CONTAINER_PATH}:rw
- ${KENZA_AWS_CONFIG_HOST_PATH}:${KENZA_WORKER_AWS_CONFIG_CONTAINER_PATH}:ro
- ${KENZA_AWS_CREDENTIALS_HOST_PATH}:${KENZA_WORKER_AWS_CREDENTIALS_CONTAINER_PATH}:ro
progress:
init: true
restart: unless-stopped
container_name: kenza_progress
image: ${KENZA_CONTAINER_REGISTRY}/progress:${KENZA_VERSION}
command: /kenza/progress
build:
context: .
dockerfile: progress/Dockerfile
args:
- APP_VERSION=$KENZA_VERSION
networks:
- pubsub
depends_on:
- api
- pubsub
volumes:
- ./api_key.secret:/run/secrets/api_key
api:
init: true
restart: unless-stopped
image: ${KENZA_CONTAINER_REGISTRY}/api:${KENZA_VERSION}
command: |
/kenza/apid
-db_name=$POSTGRES_DB
-db_host=$POSTGRES_HOST
-db_user=$POSTGRES_USER
-db_pass=$POSTGRES_PASSWORD
-api_host=$KENZA_API_HOST
-api_port=$KENZA_API_PORT
-logfile_dir=$KENZA_JOB_LOGS_CONTAINER_PATH
-aws_profile=$KENZA_API_AWS_PROFILE
-aws_config=$KENZA_API_AWS_CONFIG_CONTAINER_PATH
-aws_credentials=$KENZA_API_AWS_CREDENTIALS_CONTAINER_PATH
build:
context: .
dockerfile: api/Dockerfile
args:
- APP_VERSION=$KENZA_VERSION
- KENZA_DB_MIGRATIONS_HOST_PATH
- KENZA_DB_MIGRATIONS_CONTAINER_PATH
container_name: kenza_api
ports:
- 8080:8080
networks:
- db
- pubsub
depends_on:
- db
- pubsub
volumes:
- ./api_key.secret:/run/secrets/api_key
- ${KENZA_JOB_LOGS_HOST_PATH}:${KENZA_JOB_LOGS_CONTAINER_PATH}:ro
- ${KENZA_AWS_CONFIG_HOST_PATH}:${KENZA_API_AWS_CONFIG_CONTAINER_PATH}:ro
- ${KENZA_AWS_CREDENTIALS_HOST_PATH}:${KENZA_API_AWS_CREDENTIALS_CONTAINER_PATH}:ro
scheduler:
init: true
image: ${KENZA_CONTAINER_REGISTRY}/scheduler:${KENZA_VERSION}
build:
context: .
dockerfile: scheduler/Dockerfile
args:
- APP_VERSION=$KENZA_VERSION
command: /kenza/scheduler
restart: unless-stopped
container_name: kenza_scheduler
networks:
- pubsub
depends_on:
- api
- pubsub
volumes:
- ./api_key.secret:/run/secrets/api_key
web:
init: true
restart: unless-stopped
container_name: kenza_web
image: ${KENZA_CONTAINER_REGISTRY}/web:${KENZA_VERSION}
build:
context: .
dockerfile: _web/Dockerfile
args:
- APP_VERSION=$KENZA_VERSION
ports:
- 80:80
depends_on:
- api
networks:
db:
name: kenza_network_db
pubsub:
name: kenza_network_pubsub