Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
138 lines (133 loc) · 5.17 KB
/
Copy pathdocker-compose.yml
File metadata and controls
138 lines (133 loc) · 5.17 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# Pale Server — Docker Compose (development / local)
#
# Quick start (local lab):
# ./scripts/generate-secrets.sh
# docker compose up -d
# curl http://localhost:8090/health
#
# Production: use docker-compose.prod.yml instead.
# See docs/deploy/PRODUCTION.md
#
# All required variables fail loudly if unset — see .env.example.
services:
postgres:
image: postgres:16-alpine
container_name: pale-postgres
restart: unless-stopped
environment:
POSTGRES_DB: pale
POSTGRES_USER: pale
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD (try: openssl rand -base64 32)}"
volumes:
- pale-pgdata:/var/lib/postgresql/data
# Dev convenience only — production compose does not publish this port.
ports:
- "5433:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U pale"]
interval: 10s
timeout: 5s
retries: 5
coturn:
image: coturn/coturn:latest
container_name: pale-coturn
restart: unless-stopped
network_mode: host
volumes:
- ./turnserver.conf:/etc/turnserver.conf:ro
# For remote clients set TURN_EXTERNAL_IP and PALE_TURN_SERVER in .env.
# Without external-ip, TURN only works for clients that can reach this host's LAN address.
command:
- "-c"
- "/etc/turnserver.conf"
- "--static-auth-secret=${TURN_SECRET:?Set TURN_SECRET (try: openssl rand -base64 32)}"
- "--realm=${PALE_TURN_REALM:-pale.local}"
healthcheck:
test: ["CMD", "turnadmin", "-l"]
interval: 30s
timeout: 5s
retries: 3
nats:
image: nats:2-alpine
container_name: pale-nats
restart: unless-stopped
command: ["-js", "-m", "8222"]
# Dev convenience only — production compose does not publish these ports.
ports:
- "4222:4222"
- "8222:8222"
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:8222/healthz"]
interval: 10s
timeout: 5s
retries: 5
pale-server:
build:
context: .
dockerfile: Dockerfile.pale-server
container_name: pale-server
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
nats:
condition: service_healthy
ports:
- "8090:8080" # HTTP API
- "5060:5060" # SIP TCP (default registrar transport)
- "5060:5060/udp" # SIP UDP (disabled in-process unless explicitly enabled)
- "5061:5061" # SIP TLS (when certs are mounted)
environment:
PALE_HTTP_ADDR: "0.0.0.0:8080"
PALE_SIP_ADDR: "0.0.0.0:5060"
PALE_DATA_DIR: "/data"
PALE_DATABASE_URL: "host=postgres user=pale password=${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD (try: openssl rand -base64 32)} dbname=pale"
PALE_PG_MAX_CONNECTIONS: "20"
PALE_SERVER_TOKEN: "${PALE_SERVER_TOKEN:?Set PALE_SERVER_TOKEN (min 24 chars)}"
PALE_ADMIN_PASSWORD: "${PALE_ADMIN_PASSWORD:?Set PALE_ADMIN_PASSWORD (min 24 chars)}"
PALE_STORAGE_KEY: "${PALE_STORAGE_KEY:?Set PALE_STORAGE_KEY (min 24 chars)}"
PALE_ADMIN_USERNAME: "${PALE_ADMIN_USERNAME:-admin}"
# udp-parser is the built-in REGISTER/PBX path. Docker images are not
# built with native-pjsip; pjsip backend would leave SIP disabled.
PALE_SIP_BACKEND: "${PALE_SIP_BACKEND:-udp-parser}"
PALE_SIP_TCP: "${PALE_SIP_TCP:-true}"
PALE_SIP_UDP: "${PALE_SIP_UDP:-false}"
# SRTP on by default (matches server code default). Override only for lab debugging.
PALE_SIP_SRTP: "${PALE_SIP_SRTP:-true}"
# SIP TLS enables when both cert and key are set (or force with PALE_SIP_TLS=true).
PALE_SIP_TLS: "${PALE_SIP_TLS:-}"
PALE_SIP_TLS_CERT: "${PALE_SIP_TLS_CERT:-}"
PALE_SIP_TLS_KEY: "${PALE_SIP_TLS_KEY:-}"
PALE_SIP_TLS_PORT: "${PALE_SIP_TLS_PORT:-5061}"
PALE_SIP_EXTERNAL_ADDR: "${PALE_SIP_EXTERNAL_ADDR:-}"
PALE_SIP_TLS_EXTERNAL_ADDR: "${PALE_SIP_TLS_EXTERNAL_ADDR:-}"
PALE_ICE: "true"
PALE_STUN_SERVERS: "${PALE_STUN_SERVERS:-stun:stun.l.google.com:19302}"
PALE_STUN_IGNORE_FAILURE: "${PALE_STUN_IGNORE_FAILURE:-true}"
# For remote clients set PALE_TURN_SERVER to a reachable host, not 127.0.0.1.
PALE_TURN_SERVER: "${PALE_TURN_SERVER:-}"
PALE_TURN_TRANSPORT: "${PALE_TURN_TRANSPORT:-udp}"
PALE_TURN_USERNAME: "pale"
PALE_TURN_PASSWORD: "${TURN_SECRET:?Set TURN_SECRET (try: openssl rand -base64 32)}"
PALE_TURN_REALM: "${PALE_TURN_REALM:-pale.local}"
PALE_MAX_UPLOAD_BYTES: "${PALE_MAX_UPLOAD_BYTES:-104857600}"
PALE_RETENTION_ENFORCEMENT_INTERVAL_SECS: "${PALE_RETENTION_ENFORCEMENT_INTERVAL_SECS:-0}"
PALE_RETENTION_ENFORCEMENT_RUN_ON_STARTUP: "${PALE_RETENTION_ENFORCEMENT_RUN_ON_STARTUP:-false}"
PALE_LIVEKIT_URL: "${PALE_LIVEKIT_URL:-}"
PALE_LIVEKIT_API_KEY: "${PALE_LIVEKIT_API_KEY:-}"
PALE_LIVEKIT_API_SECRET: "${PALE_LIVEKIT_API_SECRET:-}"
NATS_URL: "${NATS_URL:-nats://nats:4222}"
RUST_LOG: "${RUST_LOG:-info}"
volumes:
- pale-data:/data
healthcheck:
test: ["CMD", "curl", "-sf", "http://localhost:8080/health"]
interval: 30s
timeout: 5s
retries: 3
start_period: 15s
volumes:
pale-pgdata:
driver: local
pale-data:
driver: local