-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
74 lines (63 loc) · 1.88 KB
/
docker-compose.yml
File metadata and controls
74 lines (63 loc) · 1.88 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
version: '3.8'
services:
# Aplicação NestJS
app:
build:
context: .
dockerfile: Dockerfile
container_name: room-stream-api
restart: unless-stopped
ports:
- "${PORT:-3000}:3000"
environment:
# Configurações do servidor
NODE_ENV: ${NODE_ENV:-production}
PORT: 3000
# CORS - ajustar para produção
CORS_ORIGIN: ${CORS_ORIGIN:-*}
# WebSocket
WEBSOCKET_NAMESPACE: ${WEBSOCKET_NAMESPACE:-/ws/rooms}
# Autenticação - API Key
API_KEY: ${API_KEY:-}
# Autenticação - Supabase
SUPABASE_URL: ${SUPABASE_URL:-}
SUPABASE_ANON_KEY: ${SUPABASE_ANON_KEY:-}
TOKEN_VALIDATION_INTERVAL: ${TOKEN_VALIDATION_INTERVAL:-300000}
# Memory Cache - Redis
REDIS_URL: ${REDIS_URL:-}
# Informações da aplicação
APP_NAME: ${APP_NAME:-RoomStream}
# GitHub API
GITHUB_CACHE_ENABLED: ${GITHUB_CACHE_ENABLED:-true}
networks:
- app-network
healthcheck:
test: ["CMD", "node", "-e", "require('http').get('http://localhost:3000/health', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
labels:
- "traefik.enable=true"
- "traefik.http.routers.room-stream.rule=Host(`localhost`)"
- "traefik.http.services.room-stream.loadbalancer.server.port=3000"
# Nginx como reverse proxy (opcional, recomendado para produção)
nginx:
image: nginx:alpine
container_name: room-stream-nginx
restart: unless-stopped
ports:
- "80:80"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- app
networks:
- app-network
profiles:
- with-nginx
networks:
app-network:
driver: bridge
# Para desenvolvimento local com hot-reload
# Uso: docker-compose -f docker-compose.yml -f docker-compose.dev.yml up