41 lines
1.2 KiB
YAML
41 lines
1.2 KiB
YAML
version: "3.8"
|
|
|
|
services:
|
|
socket-broker:
|
|
build: .
|
|
container_name: socket-broker
|
|
ports:
|
|
- "3000:3000" # WebSocket server
|
|
- "8080:8080" # HTTP API
|
|
environment:
|
|
- NODE_ENV=production
|
|
- WS_PORT=3000
|
|
- API_PORT=8080
|
|
- API_KEY=${API_KEY:-default-api-key-change-me}
|
|
- SOCKET_TOKEN_SECRET=${SOCKET_TOKEN_SECRET}
|
|
- AUTH_MODE=${AUTH_MODE:-required}
|
|
- ALLOWED_ORIGINS=${ALLOWED_ORIGINS:-https://*.comedykit.be,https://comedykit.be,https://www.comedykit.be,http://localhost:5173,http://localhost:3000,capacitor://localhost,http://localhost,https://localhost}
|
|
- MAX_TOPICS_PER_SOCKET=${MAX_TOPICS_PER_SOCKET:-20}
|
|
- SUBSCRIBE_RATE_LIMIT=${SUBSCRIBE_RATE_LIMIT:-30}
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test:
|
|
[
|
|
"CMD",
|
|
"node",
|
|
"-e",
|
|
"require('http').get('http://localhost:8080/health', (res) => { process.exit(res.statusCode === 200 ? 0 : 1) })",
|
|
]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
networks:
|
|
- socket-broker-network
|
|
env_file:
|
|
- .env
|
|
|
|
networks:
|
|
socket-broker-network:
|
|
driver: bridge
|