Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
103 lines (98 loc) · 2.57 KB
/
Copy pathdocker-compose.yml
File metadata and controls
103 lines (98 loc) · 2.57 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
services:
database:
image: postgres:18-alpine
container_name: llmgateway_postgres_db
restart: always
environment:
- POSTGRES_USER=${DB_USER:-llm_gateway}
- POSTGRES_PASSWORD=${DB_PASSWORD:-your_secure_password_here}
- POSTGRES_DB=${DB_NAME:-llmgateway}
volumes:
- pg_data:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U llm_gateway -d llmgateway"]
interval: 20s
timeout: 10s
retries: 5
networks:
- llmgateway_net
gateway:
build:
context: .
dockerfile: Dockerfile
image: llmgateway:latest
container_name: llmgateway_gateway
command:
[
"uvicorn",
"main:app",
"--host",
"${GATEWAY_HOST:-0.0.0.0}",
"--port",
"${GATEWAY_PORT:-55300}",
"--workers",
"${GATEWAY_WORKERS:-4}",
]
restart: unless-stopped
ports:
- "${GATEWAY_PORT:-55300}:${GATEWAY_PORT:-55300}"
# All configuration is loaded from the .env file.
env_file:
- .env
volumes:
- ./config:/app/config:ro
- ./data:/app/data:rw
depends_on:
database:
condition: service_healthy
networks:
- llmgateway_net
security_opt:
- no-new-privileges:true
keeper:
image: llmgateway:latest
container_name: llmgateway_keeper
command: ["python", "main.py", "keeper"]
restart: unless-stopped
environment:
- KEEPER_METRICS_PORT=${KEEPER_METRICS_PORT:-9090}
# All configuration is loaded from the .env file.
env_file:
- .env
volumes:
- ./config:/app/config:ro
- ./data:/app/data:rw
userns_mode: keep-id
depends_on:
database:
condition: service_healthy
networks:
- llmgateway_net
security_opt:
- no-new-privileges:true
# Keeper exposes internal /metrics on port 9090 (not mapped externally)
# ── Test database (for --run-postgres integration tests) ──
# Separate service on port 5433 to avoid conflicts with production database.
# Uses test-safe credentials matching CanonicalConfig.
test-database:
image: postgres:18-alpine
container_name: llmgateway_test_db
restart: unless-stopped
environment:
- POSTGRES_USER=test_user
- POSTGRES_PASSWORD=test_password
- POSTGRES_DB=test_db
ports:
- "5433:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U test_user -d test_db"]
interval: 10s
timeout: 5s
retries: 5
networks:
- llmgateway_net
volumes:
pg_data:
networks:
llmgateway_net:
driver: bridge