This repository has been archived by the owner on Jun 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-compose.yml
288 lines (269 loc) · 10.3 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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
version: "3.9"
networks:
default:
name: instill-network
services:
api_gateway:
container_name: ${API_GATEWAY_HOST}
image: ${API_GATEWAY_IMAGE}:${API_GATEWAY_VERSION}
restart: unless-stopped
environment:
API_GATEWAY_HOST: ${API_GATEWAY_HOST}
API_GATEWAY_PORT: ${API_GATEWAY_PORT}
API_GATEWAY_STATS_PORT: ${API_GATEWAY_STATS_PORT}
API_GATEWAY_METRICS_PORT: ${API_GATEWAY_METRICS_PORT}
API_GATEWAY_LOG_LEVEL: INFO
MGMT_BACKEND_HOST: ${MGMT_BACKEND_HOST}
MGMT_BACKEND_PUBLICPORT: ${MGMT_BACKEND_PUBLICPORT}
PIPELINE_BACKEND_HOST: ${PIPELINE_BACKEND_HOST}
PIPELINE_BACKEND_PUBLICPORT: ${PIPELINE_BACKEND_PUBLICPORT}
MODEL_BACKEND_HOST: ${MODEL_BACKEND_HOST}
MODEL_BACKEND_PUBLICPORT: ${MODEL_BACKEND_PUBLICPORT}
INFLUXDB_HOST: ${INFLUXDB_HOST}
INFLUXDB_PORT: ${INFLUXDB_PORT}
JAEGER_ENABLED: ${OBSERVE_ENABLED}
JAEGER_HOST: ${JAEGER_HOST}
JAEGER_PORT: ${JAEGER_LISTEN_THRIFT_PORT}
ports:
- ${API_GATEWAY_PORT}:${API_GATEWAY_PORT}
- ${API_GATEWAY_STATS_PORT}:${API_GATEWAY_STATS_PORT}
- ${API_GATEWAY_METRICS_PORT}:${API_GATEWAY_METRICS_PORT}
command: /bin/bash -c "
envsubst <config/.env.envsubst >config/.env &&
make config &&
krakend run -c krakend.json"
mgmt_backend_migrate:
container_name: ${MGMT_BACKEND_HOST}-migrate
image: ${MGMT_BACKEND_IMAGE}:${MGMT_BACKEND_VERSION}
restart: on-failure
environment:
CFG_DATABASE_USERNAME: postgres
CFG_DATABASE_PASSWORD: password
CFG_DATABASE_HOST: ${POSTGRESQL_HOST}
CFG_DATABASE_PORT: ${POSTGRESQL_PORT}
CFG_LOG_EXTERNAL: ${OBSERVE_ENABLED}
CFG_LOG_OTELCOLLECTOR_PORT: ${OTEL_COLLECTOR_PORT}
entrypoint: ./mgmt-backend-migrate
depends_on:
pg_sql:
condition: service_healthy
mgmt_backend_init:
container_name: ${MGMT_BACKEND_HOST}-init
image: ${MGMT_BACKEND_IMAGE}:${MGMT_BACKEND_VERSION}
restart: on-failure
environment:
CFG_DATABASE_HOST: ${POSTGRESQL_HOST}
CFG_DATABASE_PORT: ${POSTGRESQL_PORT}
CFG_DATABASE_USERNAME: postgres
CFG_DATABASE_PASSWORD: password
CFG_LOG_EXTERNAL: ${OBSERVE_ENABLED}
CFG_LOG_OTELCOLLECTOR_PORT: ${OTEL_COLLECTOR_PORT}
CFG_SERVER_DEFAULTUSERUID: ${DEFAULT_USER_UID}
entrypoint: ./mgmt-backend-init
depends_on:
mgmt_backend_migrate:
condition: service_completed_successfully
mgmt_backend:
container_name: ${MGMT_BACKEND_HOST}
image: ${MGMT_BACKEND_IMAGE}:${MGMT_BACKEND_VERSION}
restart: unless-stopped
environment:
CFG_SERVER_PRIVATEPORT: ${MGMT_BACKEND_PRIVATEPORT}
CFG_SERVER_PUBLICPORT: ${MGMT_BACKEND_PUBLICPORT}
CFG_SERVER_DEBUG: "false"
CFG_SERVER_USAGE_ENABLED: ${USAGE_ENABLED}
CFG_SERVER_EDITION: ${EDITION}
CFG_PIPELINEBACKEND_HOST: ${PIPELINE_BACKEND_HOST}
CFG_PIPELINEBACKEND_PUBLICPORT: ${PIPELINE_BACKEND_PUBLICPORT}
CFG_DATABASE_HOST: ${POSTGRESQL_HOST}
CFG_DATABASE_PORT: ${POSTGRESQL_PORT}
CFG_DATABASE_USERNAME: postgres
CFG_DATABASE_PASSWORD: password
CFG_LOG_EXTERNAL: ${OBSERVE_ENABLED}
CFG_LOG_OTELCOLLECTOR_PORT: ${OTEL_COLLECTOR_PORT}
CFG_TEMPORAL_CLIENTOPTIONS_HOSTPORT: ${TEMPORAL_HOST}:${TEMPORAL_PORT}
entrypoint: ./mgmt-backend
depends_on:
mgmt_backend_init:
condition: service_completed_successfully
mgmt_backend_worker:
container_name: ${MGMT_BACKEND_HOST}-worker
image: ${MGMT_BACKEND_IMAGE}:${MGMT_BACKEND_VERSION}
restart: unless-stopped
environment:
CFG_SERVER_PRIVATEPORT: ${MGMT_BACKEND_PRIVATEPORT}
CFG_SERVER_PUBLICPORT: ${MGMT_BACKEND_PUBLICPORT}
CFG_SERVER_DEBUG: "false"
CFG_SERVER_USAGE_ENABLED: ${USAGE_ENABLED}
CFG_SERVER_EDITION: ${EDITION}
CFG_PIPELINEBACKEND_HOST: ${PIPELINE_BACKEND_HOST}
CFG_PIPELINEBACKEND_PUBLICPORT: ${PIPELINE_BACKEND_PUBLICPORT}
CFG_DATABASE_HOST: ${POSTGRESQL_HOST}
CFG_DATABASE_PORT: ${POSTGRESQL_PORT}
CFG_DATABASE_USERNAME: postgres
CFG_DATABASE_PASSWORD: password
CFG_LOG_EXTERNAL: ${OBSERVE_ENABLED}
CFG_LOG_OTELCOLLECTOR_PORT: ${OTEL_COLLECTOR_PORT}
CFG_TEMPORAL_CLIENTOPTIONS_HOSTPORT: ${TEMPORAL_HOST}:${TEMPORAL_PORT}
entrypoint: ./mgmt-backend-worker
depends_on:
mgmt_backend_init:
condition: service_completed_successfully
console:
container_name: ${CONSOLE_HOST}
image: ${CONSOLE_IMAGE}:${CONSOLE_VERSION}
restart: unless-stopped
environment:
NEXT_PUBLIC_GENERAL_API_VERSION: v1beta
NEXT_PUBLIC_MODEL_API_VERSION: v1alpha
NEXT_PUBLIC_USAGE_COLLECTION_ENABLED: ${USAGE_ENABLED}
NEXT_PUBLIC_CONSOLE_EDITION: ${EDITION}
NEXT_PUBLIC_CONSOLE_BASE_URL: http://${INSTILL_CORE_HOST}:${CONSOLE_PORT}
NEXT_PUBLIC_API_GATEWAY_URL: http://${INSTILL_CORE_HOST}:${API_GATEWAY_PORT}
NEXT_SERVER_API_GATEWAY_URL: http://${API_GATEWAY_HOST}:${API_GATEWAY_PORT}
NEXT_PUBLIC_INSTILL_AI_USER_COOKIE_NAME: instill-ai-user
NEXT_PUBLIC_SELF_SIGNED_CERTIFICATION: "false"
NODE_ENV: production
ports:
- ${CONSOLE_PORT}:3000
entrypoint: ./entrypoint.sh
pg_sql:
container_name: ${POSTGRESQL_HOST}
image: ${POSTGRESQL_IMAGE}:${POSTGRESQL_VERSION}-alpine
restart: unless-stopped
environment:
POSTGRES_PASSWORD: password
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
timeout: 20s
retries: 10
elasticsearch:
container_name: ${ELASTICSEARCH_HOST}
image: ${ELASTICSEARCH_IMAGE}:${ELASTICSEARCH_VERSION}
restart: unless-stopped
environment:
- cluster.routing.allocation.disk.threshold_enabled=true
- cluster.routing.allocation.disk.watermark.low=512mb
- cluster.routing.allocation.disk.watermark.high=256mb
- cluster.routing.allocation.disk.watermark.flood_stage=128mb
- discovery.type=single-node
- ES_JAVA_OPTS=-Xms256m -Xmx256m
- xpack.security.enabled=false
volumes:
- /var/lib/elasticsearch/data
temporal:
container_name: temporal
image: ${TEMPORAL_IMAGE}:${TEMPORAL_VERSION}
restart: unless-stopped
environment:
DB: postgresql
DB_PORT: ${POSTGRESQL_PORT}
POSTGRES_USER: postgres
POSTGRES_PWD: password
POSTGRES_SEEDS: ${POSTGRESQL_HOST}
DYNAMIC_CONFIG_FILE_PATH: config/dynamicconfig/docker.yaml
ENABLE_ES: "true"
ES_SEEDS: elasticsearch
ES_VERSION: v7
healthcheck:
test: ["CMD", "tctl", "--address", "temporal:7233", "workflow", "list"]
interval: 10s
timeout: 1m
retries: 10
depends_on:
- pg_sql
- elasticsearch
temporal_ui:
container_name: ${TEMPORAL_UI_HOST}
image: ${TEMPORAL_UI_IMAGE}:${TEMPORAL_UI_VERSION}
restart: unless-stopped
environment:
TEMPORAL_ADDRESS: ${TEMPORAL_HOST}:${TEMPORAL_PORT}
ports:
- ${TEMPORAL_UI_PORT}:8080
depends_on:
- temporal
redis:
container_name: ${REDIS_HOST}
image: ${REDIS_IMAGE}:${REDIS_VERSION}-alpine${ALPINE_VERSION}
restart: unless-stopped
environment:
ALLOW_EMPTY_PASSWORD: "true"
redoc_openapi:
container_name: redoc-openapi
image: ${REDOC_IMAGE}:${REDOC_OPENAPI_VERSION}
environment:
- SPEC_URL=https://raw.githubusercontent.com/instill-ai/protobufs/main/openapiv2/openapiv2.swagger.yaml
ports:
- ${REDOC_OPENAPI_PORT}:80
etcd:
container_name: ${ETCD_HOST}
image: ${ETCD_IMAGE}:v${ETCD_VERSION}
restart: unless-stopped
environment:
ETCD_NAME: ${ETCD_HOST}
ETCD_ADVERTISE_CLIENT_URLS: http://${ETCD_HOST}:${ETCD_CLIENT_PORT}
ETCD_LISTEN_CLIENT_URLS: http://0.0.0.0:${ETCD_CLIENT_PORT}
ETCD_INITIAL_ADVERTISE_PEER_URLS: http://${ETCD_HOST}:${ETCD_PEER_PORT}
ETCD_LISTEN_PEER_URLS: http://0.0.0.0:${ETCD_PEER_PORT}
ETCD_INITIAL_CLUSTER_TOKEN: ${ETCD_CLUSTER_TOKEN}
ETCD_INITIAL_CLUSTER_STATE: ${ETCD_CLUSTER_STATE}
ETCD_INITIAL_CLUSTER: ${ETCD_HOST}=http://${ETCD_HOST}:${ETCD_PEER_PORT}
ETCDCTL_API: ${ETCDCTL_API}
ETCD_AUTO_COMPACTION_MODE: ${ETCD_AUTO_COMPACTION_MODE}
ETCD_AUTO_COMPACTION_RETENTION: ${ETCD_AUTO_COMPACTION_RETENTION}
influxdb:
container_name: ${INFLUXDB_HOST}
image: ${INFLUXDB_IMAGE}:${INFLUXDB_VERSION}-alpine
environment:
DOCKER_INFLUXDB_INIT_MODE: setup
DOCKER_INFLUXDB_INIT_USERNAME: admin
DOCKER_INFLUXDB_INIT_PASSWORD: password
DOCKER_INFLUXDB_INIT_ORG: instill-ai
DOCKER_INFLUXDB_INIT_BUCKET: krakend
DOCKER_INFLUXDB_INIT_RETENTION: 1w
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN: i-love-instill-ai
DOCKER_INFLUXDB_BUCKET_VDP: instill-ai
volumes:
- ${OBSERVE_CONFIG_DIR_PATH}/influxdb:/docker-entrypoint-initdb.d
ports:
- ${INFLUXDB_PORT}:8086
openfga_createdb:
depends_on:
pg_sql:
condition: service_healthy
image: ${POSTGRESQL_IMAGE}:${POSTGRESQL_VERSION}-alpine
container_name: ${OPENFGA_HOST}_createdb
command: bash -c 'createdb -h ${POSTGRESQL_HOST} -U postgres -w openfga || true'
environment:
PGPASSWORD: password
openfga_migrate:
depends_on:
openfga_createdb:
condition: service_completed_successfully
image: ${OPENFGA_IMAGE}:${OPENFGA_VERSION}
container_name: ${OPENFGA_HOST}_migrate
command: migrate
environment:
- OPENFGA_DATASTORE_ENGINE=postgres
- OPENFGA_DATASTORE_URI=postgres://postgres:password@${POSTGRESQL_HOST}:${POSTGRESQL_PORT}/openfga?sslmode=disable
openfga:
depends_on:
openfga_migrate:
condition: service_completed_successfully
container_name: ${OPENFGA_HOST}
image: ${OPENFGA_IMAGE}:${OPENFGA_VERSION}
restart: unless-stopped
environment:
- OPENFGA_DATASTORE_ENGINE=postgres
- OPENFGA_DATASTORE_URI=postgres://postgres:password@${POSTGRESQL_HOST}:${POSTGRESQL_PORT}/openfga?sslmode=disable
command: run
temporal_admin_tools_core:
container_name: temporal-admin-tools-core
image: ${TEMPORAL_ADMIN_TOOLS_IMAGE}:${TEMPORAL_ADMIN_TOOLS_VERSION}
restart: on-failure
environment:
TEMPORAL_CLI_ADDRESS: ${TEMPORAL_HOST}:${TEMPORAL_PORT}
entrypoint: ["/bin/bash", "-c"]
command: |
'if [[ ! $(tctl --namespace mgmt-backend namespace list | grep mgmt-backend) ]]; then tctl --namespace mgmt-backend namespace register; fi'