-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
93 lines (89 loc) · 2.83 KB
/
docker-compose.yml
File metadata and controls
93 lines (89 loc) · 2.83 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
version: '3.9'
services:
# ─── Base de datos ────────────────────────────────────────────────
db:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_DB: eventroll
POSTGRES_USER: eventroll
POSTGRES_PASSWORD: ${DB_PASSWORD:?DB_PASSWORD requerida en .env}
volumes:
- pgdata:/var/lib/postgresql/data
# Puerto NO expuesto al host — solo accesible dentro de la red Docker
# Para conectarte directamente usa: docker compose exec db psql -U eventroll
healthcheck:
test: ["CMD-SHELL", "pg_isready -U eventroll -d eventroll"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
deploy:
resources:
limits:
cpus: '1'
memory: 512M
# ─── Backend API ──────────────────────────────────────────────────
backend:
build:
context: ./backend
dockerfile: Dockerfile
restart: unless-stopped
depends_on:
db:
condition: service_healthy
environment:
NODE_ENV: production
PORT: 3000
DATABASE_URL: postgresql://eventroll:${DB_PASSWORD}@db:5432/eventroll
JWT_SECRET: ${JWT_SECRET:?JWT_SECRET requerida en .env}
JWT_EXPIRES_IN: ${JWT_EXPIRES_IN:-24h}
CORS_ORIGIN: ${CORS_ORIGIN:-http://localhost}
RATE_LIMIT_WINDOW_MS: ${RATE_LIMIT_WINDOW_MS:-900000}
RATE_LIMIT_MAX: ${RATE_LIMIT_MAX:-100}
SALT_ROUNDS: ${SALT_ROUNDS:-10}
LOG_LEVEL: ${LOG_LEVEL:-info}
EMAIL_HOST: ${EMAIL_HOST:-}
EMAIL_PORT: ${EMAIL_PORT:-587}
EMAIL_SECURE: ${EMAIL_SECURE:-false}
EMAIL_USER: ${EMAIL_USER:-}
EMAIL_PASS: ${EMAIL_PASS:-}
EMAIL_ADMIN_BACKUP: ${EMAIL_ADMIN_BACKUP:-}
EMAIL_FROM_NAME: ${EMAIL_FROM_NAME:-EventRoll}
FRONTEND_URL: ${FRONTEND_URL:-http://localhost}
ports:
- "3000:3000"
volumes:
- backend_logs:/app/logs
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:3000/health || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
deploy:
resources:
limits:
cpus: '1'
memory: 512M
# ─── Frontend (nginx) ─────────────────────────────────────────────
frontend:
build:
context: .
dockerfile: Dockerfile.frontend
restart: unless-stopped
depends_on:
backend:
condition: service_healthy
ports:
- "80:80"
deploy:
resources:
limits:
cpus: '0.5'
memory: 128M
volumes:
pgdata:
driver: local
backend_logs:
driver: local