Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
83 lines (78 loc) · 2.14 KB
/
Copy pathdocker-compose.yml
File metadata and controls
83 lines (78 loc) · 2.14 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
services:
octw-db:
image: postgres:16-alpine
environment:
POSTGRES_DB: octw
POSTGRES_USER: octw
POSTGRES_PASSWORD: octw
ports:
- "5432:5432"
volumes:
- octw_pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U octw"]
interval: 5s
timeout: 3s
retries: 5
networks:
- octw_control
octw-cache:
image: redis:7-alpine
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
networks:
- octw_control
octw-api:
build:
context: .
dockerfile: Dockerfile
command: ["uvicorn", "octw.api.app:app", "--host", "0.0.0.0", "--port", "8000"]
# Runs as root to access Docker socket for tenant container management.
# The edge proxy runs as non-root (UID 1000).
user: "0:0"
ports:
- "8000:8000"
environment:
OCTW_DB_URL: "postgresql+asyncpg://octw:octw@octw-db:5432/octw"
OCTW_REDIS_URL: "redis://octw-cache:6379/0"
OCTW_KEK: "${OCTW_KEK}"
OCTW_JWT_SECRET: "${OCTW_JWT_SECRET:-change-me-in-production}"
OCTW_ZAI_API_KEY: "${OCTW_ZAI_API_KEY:-}"
OCTW_MOONSHOT_API_KEY: "${OCTW_MOONSHOT_API_KEY:-}"
OCTW_MINIMAX_API_KEY: "${OCTW_MINIMAX_API_KEY:-}"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /var/lib/octw:/var/lib/octw
depends_on:
octw-db:
condition: service_healthy
octw-cache:
condition: service_healthy
networks:
- octw_control
octw-edge:
build:
context: .
dockerfile: Dockerfile
command: ["uvicorn", "octw.edge.proxy:edge_app", "--host", "0.0.0.0", "--port", "8443"]
ports:
- "8443:8443"
environment:
OCTW_DB_URL: "postgresql+asyncpg://octw:octw@octw-db:5432/octw"
OCTW_REDIS_URL: "redis://octw-cache:6379/0"
OCTW_JWT_SECRET: "${OCTW_JWT_SECRET:-change-me-in-production}"
OCTW_EDGE_DOMAIN: "${OCTW_EDGE_DOMAIN:-octw.example.com}"
depends_on:
- octw-api
networks:
- octw_control
volumes:
octw_pgdata:
networks:
octw_control:
driver: bridge