Repository navigation
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
88 lines (85 loc) · 3.31 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
88 lines (85 loc) · 3.31 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
services:
campux:
build:
context: .
image: rockchin/campux:${CAMPUX_IMAGE_TAG:-local}
container_name: campux
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
minio:
condition: service_started
environment:
NODE_ENV: production
DATABASE_URL: postgresql://campux:campux@postgres:5432/campux_next
CAMPUX_SERVER_HOST: 0.0.0.0
CAMPUX_SERVER_PORT: 8989
CAMPUX_WEB_ORIGIN: ${CAMPUX_WEB_ORIGIN:-http://localhost:8989}
CAMPUX_WEB_DIST_DIR: /app/apps/web/dist
CAMPUX_TENANT_DOMAIN_SUFFIX: ${CAMPUX_TENANT_DOMAIN_SUFFIX:-}
CAMPUX_TENANT_DOMAIN_TARGET: ${CAMPUX_TENANT_DOMAIN_TARGET:-}
CAMPUX_TENANT_DOMAIN_PROXIED: ${CAMPUX_TENANT_DOMAIN_PROXIED:-true}
CAMPUX_TENANT_DOMAIN_TTL: ${CAMPUX_TENANT_DOMAIN_TTL:-1}
CAMPUX_CLOUDFLARE_API_TOKEN: ${CAMPUX_CLOUDFLARE_API_TOKEN:-}
CAMPUX_CLOUDFLARE_ZONE_ID: ${CAMPUX_CLOUDFLARE_ZONE_ID:-}
# REQUIRED: encrypts stored bot session cookies. Generate with
# `openssl rand -hex 32` and put it in a .env next to this compose file.
# The `:?` guard makes `docker compose up` fail loudly if it is unset
# instead of silently shipping the insecure placeholder.
CAMPUX_BOT_SESSION_SECRET: ${CAMPUX_BOT_SESSION_SECRET:?set CAMPUX_BOT_SESSION_SECRET in your .env (openssl rand -hex 32)}
S3_ENDPOINT: http://minio:9000
S3_REGION: auto
S3_BUCKET: campux-next
S3_ACCESS_KEY_ID: ${S3_ACCESS_KEY_ID:-campux}
S3_SECRET_ACCESS_KEY: ${S3_SECRET_ACCESS_KEY:-campux-secret}
S3_PUBLIC_BASE_URL: ${S3_PUBLIC_BASE_URL:-http://localhost:9000/campux-next}
PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH: /usr/bin/chromium-browser
# Anonymous telemetry: production instances report aggregate counters
# (instance/tenant/user/post totals — never content or identities) to
# dash.campux.top every 2 h. Set to "true" to opt out; details:
# https://docs.campux.top/admin/telemetry
CAMPUX_TELEMETRY_DISABLED: ${CAMPUX_TELEMETRY_DISABLED:-}
# Optional public label for your instance on the fleet dashboard.
CAMPUX_TELEMETRY_INSTANCE_NAME: ${CAMPUX_TELEMETRY_INSTANCE_NAME:-}
ports:
- "8989:8989"
healthcheck:
test: ["CMD-SHELL", "bun -e \"fetch('http://127.0.0.1:8989/api/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))\""]
interval: 15s
timeout: 5s
retries: 10
start_period: 20s
postgres:
image: postgres:16-alpine
container_name: campux-postgres
restart: unless-stopped
environment:
POSTGRES_USER: campux
POSTGRES_PASSWORD: campux
POSTGRES_DB: campux_next
ports:
- "5432:5432"
volumes:
- campux-postgres:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U campux -d campux_next"]
interval: 10s
timeout: 5s
retries: 10
minio:
image: minio/minio:RELEASE.2025-04-22T22-12-26Z
container_name: campux-minio
restart: unless-stopped
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: ${S3_ACCESS_KEY_ID:-campux}
MINIO_ROOT_PASSWORD: ${S3_SECRET_ACCESS_KEY:-campux-secret}
ports:
- "9000:9000"
- "9001:9001"
volumes:
- campux-minio:/data
volumes:
campux-postgres:
campux-minio: