-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
84 lines (78 loc) · 2.16 KB
/
Copy pathdocker-compose.yml
File metadata and controls
84 lines (78 loc) · 2.16 KB
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
x-answer-engine-image: &answer-engine-image
image: "${ANSWER_ENGINE_IMAGE:-ghcr.io/the-answerai/answer-engine:1.1.2}"
pull_policy: "${ANSWER_ENGINE_PULL_POLICY:-missing}"
services:
postgres:
image: pgvector/pgvector:pg16
environment:
POSTGRES_DB: "${DATABASE_NAME:-answerengine}"
POSTGRES_USER: "${DATABASE_USER:-postgres}"
POSTGRES_PASSWORD: "${DATABASE_PASSWORD:-postgres}"
ports:
- "127.0.0.1:${DATABASE_PORT_HOST:-5433}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DATABASE_USER:-postgres} -d ${DATABASE_NAME:-answerengine}"]
interval: 5s
timeout: 5s
retries: 20
restart: unless-stopped
redis:
image: redis:7-alpine
command: ["redis-server", "--appendonly", "yes"]
ports:
- "127.0.0.1:${REDIS_PORT_HOST:-6380}:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 20
restart: unless-stopped
migrate:
<<: *answer-engine-image
command: ["node", "dist/scripts/migrate.js"]
env_file: [.env.compose]
depends_on:
postgres:
condition: service_healthy
restart: "no"
init:
<<: *answer-engine-image
command: ["node", "dist/scripts/init.js"]
env_file: [.env.compose]
depends_on:
migrate:
condition: service_completed_successfully
restart: "no"
api:
<<: *answer-engine-image
command: ["node", "dist/server.js"]
env_file: [.env.compose]
ports:
- "127.0.0.1:${ANSWER_ENGINE_PORT:-5050}:5000"
volumes:
- answerengine_data:/data
extra_hosts:
- host.docker.internal:host-gateway
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
init:
condition: service_completed_successfully
healthcheck:
test: ["CMD", "curl", "--fail", "--silent", "http://127.0.0.1:5000/health"]
interval: 5s
timeout: 5s
start_period: 20s
retries: 20
restart: unless-stopped
init: true
volumes:
postgres_data:
redis_data:
answerengine_data: