-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.scalable.yml
More file actions
68 lines (64 loc) · 1.76 KB
/
Copy pathdocker-compose.scalable.yml
File metadata and controls
68 lines (64 loc) · 1.76 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
# =============================================================================
# VLM V2 — Scalable Mode (self-hosted, multiple servers)
#
# Postgres + Redis for Colyseus cross-server presence.
# Can run multiple vlm containers behind a load balancer.
#
# Usage:
# cp .env.example .env # edit vars
# docker compose -f docker-compose.scalable.yml up -d
# docker compose -f docker-compose.scalable.yml up -d --scale vlm=3 # 3 servers
# =============================================================================
services:
postgres:
image: postgres:16-alpine
restart: unless-stopped
ports:
- "5432:5432"
environment:
POSTGRES_DB: vlm
POSTGRES_USER: vlm
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-vlm_prod}
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U vlm"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
restart: unless-stopped
ports:
- "6379:6379"
volumes:
- redisdata:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
vlm:
build: .
restart: unless-stopped
ports:
- "${PORT:-3010}:3010"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
environment:
VLM_MODE: scalable
DATABASE_URL: postgresql://vlm:${POSTGRES_PASSWORD:-vlm_prod}@postgres:5432/vlm
REDIS_URL: redis://redis:6379
JWT_SECRET: ${JWT_SECRET:?Set JWT_SECRET in .env}
PUBLIC_URL: ${PUBLIC_URL:-http://localhost:3010}
STORAGE_PROVIDER: local
LOCAL_STORAGE_PATH: /app/uploads
volumes:
- uploads:/app/uploads
volumes:
pgdata:
redisdata:
uploads: