Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
64 lines (61 loc) · 1.77 KB
/
Copy pathdocker-compose.yml
File metadata and controls
64 lines (61 loc) · 1.77 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
# Production-leaning compose. For local hot-reload development, use the
# documented override in docker-compose.override.yml.example (copy to
# docker-compose.override.yml — it is gitignored).
services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: ${POSTGRES_USER:-concord}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD in .env}
POSTGRES_DB: ${POSTGRES_DB:-concord}
volumes: [pg_data:/var/lib/postgresql/data]
# Bind to loopback only; do not expose the DB on all interfaces.
ports: ["127.0.0.1:5432:5432"]
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-concord}"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
redis:
image: redis:7-alpine
ports: ["127.0.0.1:6379:6379"]
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
api:
build: .
ports: ["127.0.0.1:8000:8000"]
env_file: .env
environment:
CONCORD_DB_PATH: /data/concord.db
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "python", "-c",
"import urllib.request,sys; sys.exit(0) if urllib.request.urlopen('http://127.0.0.1:8000/health').status==200 else sys.exit(1)"]
interval: 30s
timeout: 3s
start_period: 10s
retries: 3
volumes:
- concord_data:/data
- ./connectors/tools.yaml:/app/connectors/tools.yaml:ro
# Least privilege at the container level.
read_only: true
tmpfs:
- /tmp
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
restart: unless-stopped
volumes:
pg_data:
concord_data: