-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
143 lines (130 loc) · 4.22 KB
/
Copy pathdocker-compose.yml
File metadata and controls
143 lines (130 loc) · 4.22 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# Docker Compose for LMRing Self-hosted Deployment
#
# Usage:
# 1. Copy .env.example to .env and configure
# 2. Run: docker compose up -d
# 3. Run migrations: docker compose exec app pnpm db:migrate
# 4. Access: http://localhost:3000
services:
# PostgreSQL Database
postgres:
image: postgres:17-alpine
container_name: lmring-postgres
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-lmring}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-lmring}
POSTGRES_DB: ${POSTGRES_DB:-lmring}
volumes:
- postgres_data:/var/lib/postgresql/data
- ./docker/postgres/init-supabase-compat.sql:/docker-entrypoint-initdb.d/01-supabase-compat.sql:ro
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-lmring} -d ${POSTGRES_DB:-lmring}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
networks:
- lmring-network
# MinIO Object Storage
minio:
image: minio/minio:latest
container_name: lmring-minio
restart: unless-stopped
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER:-lmring}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:-lmring_minio_password}
volumes:
- minio_data:/data
ports:
- "9000:9000" # API
- "9001:9001" # Console
healthcheck:
test: ["CMD", "mc", "ready", "local"]
interval: 30s
timeout: 10s
retries: 3
networks:
- lmring-network
# MinIO bucket initialization
minio-init:
image: minio/mc:latest
container_name: lmring-minio-init
depends_on:
minio:
condition: service_healthy
entrypoint: >
/bin/sh -c "
mc alias set myminio http://minio:9000 $${MINIO_ROOT_USER} $${MINIO_ROOT_PASSWORD};
mc mb myminio/$${MINIO_BUCKET} --ignore-existing;
mc anonymous set download myminio/$${MINIO_BUCKET}/public;
exit 0;
"
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER:-lmring}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:-lmring_minio_password}
MINIO_BUCKET: ${MINIO_BUCKET:-lmring-files}
networks:
- lmring-network
# LMRing Application
app:
build:
context: .
dockerfile: Dockerfile
args:
DEPLOYMENT_MODE: selfhost
NEXT_PUBLIC_DEPLOYMENT_MODE: selfhost
NEXT_PUBLIC_APP_URL: ${NEXT_PUBLIC_APP_URL:-http://localhost:3000}
container_name: lmring-app
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
minio:
condition: service_healthy
ports:
- "${PORT:-3000}:3000"
environment:
# Deployment Mode
DEPLOYMENT_MODE: selfhost
NEXT_PUBLIC_DEPLOYMENT_MODE: selfhost
# Database
DATABASE_URL: postgresql://${POSTGRES_USER:-lmring}:${POSTGRES_PASSWORD:-lmring}@postgres:5432/${POSTGRES_DB:-lmring}
# Better Auth (required)
BETTER_AUTH_SECRET: ${BETTER_AUTH_SECRET}
BETTER_AUTH_URL: ${BETTER_AUTH_URL:-http://localhost:3000}
# Encryption (required)
ENCRYPTION_KEY: ${ENCRYPTION_KEY}
# OAuth (optional - leave empty to disable)
GITHUB_CLIENT_ID: ${GITHUB_CLIENT_ID:-}
GITHUB_CLIENT_SECRET: ${GITHUB_CLIENT_SECRET:-}
GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID:-}
GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET:-}
# App URL
NEXT_PUBLIC_APP_URL: ${NEXT_PUBLIC_APP_URL:-http://localhost:3000}
# MinIO Object Storage
MINIO_ENDPOINT: ${MINIO_ENDPOINT:-minio}
MINIO_PORT: ${MINIO_PORT:-9000}
MINIO_USE_SSL: ${MINIO_USE_SSL:-false}
MINIO_ACCESS_KEY: ${MINIO_ACCESS_KEY:-lmring}
MINIO_SECRET_KEY: ${MINIO_SECRET_KEY:-lmring_minio_password}
MINIO_BUCKET: ${MINIO_BUCKET:-lmring-files}
LLM_IMAGE_BASE64: ${LLM_IMAGE_BASE64:-1}
# Optional monitoring
NEXT_PUBLIC_SENTRY_DSN: ${NEXT_PUBLIC_SENTRY_DSN:-}
NEXT_PUBLIC_SENTRY_DISABLED: ${NEXT_PUBLIC_SENTRY_DISABLED:-true}
NEXT_PUBLIC_POSTHOG_KEY: ${NEXT_PUBLIC_POSTHOG_KEY:-}
NEXT_PUBLIC_POSTHOG_HOST: ${NEXT_PUBLIC_POSTHOG_HOST:-}
networks:
- lmring-network
volumes:
postgres_data:
driver: local
minio_data:
driver: local
networks:
lmring-network:
driver: bridge