-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcompose.yaml
More file actions
87 lines (87 loc) · 2.08 KB
/
Copy pathcompose.yaml
File metadata and controls
87 lines (87 loc) · 2.08 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
85
86
87
---
services:
index:
image: elasticsearch:7.17.3
container_name: index
environment:
- cluster.name=docker-cluster
- bootstrap.memory_lock=true
- discovery.type=single-node
- xpack.security.enabled=false
- ES_JAVA_OPTS=-Xms512m -Xmx512m
ulimits:
memlock:
soft: -1
hard: -1
ports: [9200:9200, 9300:9300]
volumes: [esdata:/usr/share/elasticsearch/data]
healthcheck:
test: [CMD-SHELL, curl -s http://localhost:9200 >/dev/null || exit 1]
interval: 1m
timeout: 20s
retries: 5
start_period: 1m
queue:
image: redis:6.0
container_name: queue
ports: [6379:6379]
healthcheck:
test: [CMD, redis-cli, ping]
interval: 10s
timeout: 5s
retries: 3
database:
image: postgres:14
container_name: database
environment: [POSTGRES_USER=postgres, POSTGRES_HOST_AUTH_METHOD=trust]
env_file: [.env]
ports: [5432:5432]
volumes: [pgdata:/var/lib/postgresql/data]
healthcheck:
test: [CMD, pg_isready, -U, postgres]
interval: 1m
timeout: 30s
retries: 5
start_period: 1m
restart: unless-stopped
api:
build:
context: .
dockerfile: Dockerfile
container_name: api
deploy:
resources:
reservations:
cpus: '0.5'
memory: 2G
limits:
cpus: '1.0'
memory: 4G
env_file: [.env]
command: [poetry, run, /app/start-server-dev.sh]
ports:
- 8080:80 # API port
- 5678:5678 # Debug port
volumes: [.:/app]
networks: [default, api_network]
depends_on:
index:
condition: service_healthy
queue:
condition: service_healthy
database:
condition: service_healthy
healthcheck:
test: [CMD, curl, -f, http://localhost:8000/healthcheck/]
interval: 1m
timeout: 30s
retries: 5
start_period: 30s
restart: unless-stopped
volumes:
esdata:
pgdata:
# External network used for api access by other services (e.g., chatbot API)
networks:
api_network:
name: api_network