Repository navigation
Expand file tree
/
Copy pathdocker-compose.multi-user.yml
More file actions
78 lines (74 loc) · 3.04 KB
/
Copy pathdocker-compose.multi-user.yml
File metadata and controls
78 lines (74 loc) · 3.04 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
# ─────────────────────────────────────────────────────────────
# LearnerVerse - Multi-User Mode (self-hosted)
#
# 1. Copy the sample env: cp multi_user.sample.env .env.multi-user
# 2. Fill in Auth0 credentials and any API keys
# 3. Add http://localhost:3000 to your Auth0 allowed callbacks and origins
# 4. Run:
# docker compose --env-file .env.multi-user \
# -f docker-compose.multi-user.yml up --build
#
# Includes: PostgreSQL + FastAPI + React/Nginx + Auth0 authentication
# Payment gateway is disabled - all users get full access.
# ─────────────────────────────────────────────────────────────
services:
# ── PostgreSQL ─────────────────────────────────────────────
db:
image: postgres:17-alpine
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 5s
timeout: 3s
retries: 10
# ── Backend (FastAPI) ──────────────────────────────────────
backend:
build:
context: ./backend
dockerfile: Dockerfile
image: learnerverse-multi-backend
restart: unless-stopped
init: true
env_file: ${SELF_HOST_ENV_FILE:-.env.multi-user}
volumes:
- uploads:/app/uploads
depends_on:
db:
condition: service_healthy
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/api/v1/health')"]
interval: 10s
timeout: 5s
retries: 5
start_period: 20s
# ── Frontend (React + Nginx) ───────────────────────────────
frontend:
build:
context: . # Root context so private/ symlinks resolve
dockerfile: frontend/Dockerfile.multi-user
args:
# Self-hosted browsers always use Nginx's same-origin API proxy.
# Do not accept legacy localhost overrides from older env files.
VITE_API_BASE_URL: /api/v1
VITE_SINGLE_USER_MODE: "false"
VITE_AUTH0_DOMAIN: ${VITE_AUTH0_DOMAIN}
VITE_AUTH0_CLIENT_ID: ${VITE_AUTH0_CLIENT_ID}
VITE_AUTH0_AUDIENCE: ${VITE_AUTH0_AUDIENCE}
VITE_PAYMENT_GATEWAY_ENABLED: "false"
VITE_SUPERADMIN_EMAILS: ${VITE_SUPERADMIN_EMAILS:-}
image: learnerverse-multi-frontend
restart: unless-stopped
ports:
- "${APP_BIND_ADDRESS:-0.0.0.0}:${APP_PORT:-3000}:80"
depends_on:
backend:
condition: service_healthy
volumes:
pgdata:
uploads: