-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.full.yml
More file actions
97 lines (90 loc) · 2.39 KB
/
Copy pathdocker-compose.full.yml
File metadata and controls
97 lines (90 loc) · 2.39 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
# LMStack Full Stack Docker Compose Configuration
# Includes backend, frontend, database, and worker on a single machine
# Usage: docker compose -f docker-compose.full.yml up -d
version: '3.8'
services:
# PostgreSQL Database
db:
image: postgres:15-alpine
container_name: lmstack-db
environment:
POSTGRES_USER: ${POSTGRES_USER:-lmstack}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-lmstack}
POSTGRES_DB: ${POSTGRES_DB:-lmstack}
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-lmstack}"]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
networks:
- lmstack
# Backend API Server
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: lmstack-backend
environment:
LMSTACK_DATABASE_URL: postgresql+asyncpg://${POSTGRES_USER:-lmstack}:${POSTGRES_PASSWORD:-lmstack}@db:5432/${POSTGRES_DB:-lmstack}
LMSTACK_SECRET_KEY: ${SECRET_KEY:-change-me-in-production}
LMSTACK_DEBUG: ${DEBUG:-false}
LMSTACK_CORS_ORIGINS: ${CORS_ORIGINS:-*}
ports:
- "${BACKEND_PORT:-52000}:52000"
depends_on:
db:
condition: service_healthy
restart: unless-stopped
networks:
- lmstack
# Frontend Web UI
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
VITE_API_URL: ${VITE_API_URL:-/api}
container_name: lmstack-frontend
ports:
- "${FRONTEND_PORT:-80}:80"
depends_on:
- backend
restart: unless-stopped
networks:
- lmstack
# Worker Agent (GPU node)
worker:
build:
context: ./worker
dockerfile: Dockerfile
container_name: lmstack-worker
environment:
BACKEND_URL: http://backend:52000
WORKER_TOKEN: ${WORKER_TOKEN:-}
WORKER_NAME: ${WORKER_NAME:-local-worker}
AGENT_PORT: 52001
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ${HF_CACHE_DIR:-~/.cache/huggingface}:/root/.cache/huggingface
depends_on:
- backend
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
restart: unless-stopped
privileged: true
networks:
- lmstack
volumes:
postgres_data:
driver: local
networks:
lmstack:
driver: bridge