-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
267 lines (260 loc) · 8.44 KB
/
docker-compose.yml
File metadata and controls
267 lines (260 loc) · 8.44 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
# =============================================================================
# LynxPrompt Docker Compose - Development Environment
# =============================================================================
# This file is for LOCAL DEVELOPMENT ONLY.
# Production deployments use a private GitOps repository with real secrets.
#
# Quick Start:
# 1. Copy env.example to .env and fill in OAuth credentials
# 2. Run: docker compose up -d
# 3. Access: http://localhost:3000
# =============================================================================
services:
# ==========================================================================
# APP DATABASE - System templates, platforms, languages
# ==========================================================================
postgres-app:
image: postgres:18-alpine
container_name: lynxprompt-postgres-app
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "3"
environment:
POSTGRES_DB: lynxprompt_app
POSTGRES_USER: lynxprompt_app
POSTGRES_PASSWORD: ${POSTGRES_APP_PASSWORD:-dev_app_password_change_me}
PGDATA: /data/pgdata
volumes:
- postgres_app_data:/data
networks:
- lynxprompt
healthcheck:
test: ["CMD-SHELL", "pg_isready -U lynxprompt_app"]
interval: 10s
timeout: 5s
retries: 5
deploy:
resources:
limits:
memory: 512M
reservations:
memory: 128M
security_opt:
- no-new-privileges:true
# ==========================================================================
# USER DATABASE - Golden data (users, sessions, projects)
# ==========================================================================
postgres-users:
image: postgres:18-alpine
container_name: lynxprompt-postgres-users
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "3"
environment:
POSTGRES_DB: lynxprompt_users
POSTGRES_USER: lynxprompt_users
POSTGRES_PASSWORD: ${POSTGRES_USERS_PASSWORD:-dev_users_password_change_me}
PGDATA: /data/pgdata
volumes:
- postgres_users_data:/data
networks:
- lynxprompt
healthcheck:
test: ["CMD-SHELL", "pg_isready -U lynxprompt_users"]
interval: 10s
timeout: 5s
retries: 5
deploy:
resources:
limits:
memory: 1G
reservations:
memory: 256M
security_opt:
- no-new-privileges:true
# ==========================================================================
# BLOG DATABASE - Blog posts and content
# Critical backups - original authored content
# ==========================================================================
postgres-blog:
image: postgres:18-alpine
container_name: lynxprompt-postgres-blog
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "3"
environment:
POSTGRES_DB: lynxprompt_blog
POSTGRES_USER: lynxprompt_blog
POSTGRES_PASSWORD: ${POSTGRES_BLOG_PASSWORD:-dev_blog_password_change_me}
PGDATA: /data/pgdata
volumes:
- postgres_blog_data:/data
networks:
- lynxprompt
healthcheck:
test: ["CMD-SHELL", "pg_isready -U lynxprompt_blog"]
interval: 10s
timeout: 5s
retries: 5
deploy:
resources:
limits:
memory: 256M
reservations:
memory: 64M
security_opt:
- no-new-privileges:true
# ==========================================================================
# SUPPORT DATABASE - Feedback forum data (bugs, suggestions, votes)
# Medium priority backups
# ==========================================================================
postgres-support:
image: postgres:18-alpine
container_name: lynxprompt-postgres-support
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "3"
environment:
POSTGRES_DB: lynxprompt_support
POSTGRES_USER: lynxprompt_support
POSTGRES_PASSWORD: ${POSTGRES_SUPPORT_PASSWORD:-dev_support_password_change_me}
PGDATA: /data/pgdata
volumes:
- postgres_support_data:/data
networks:
- lynxprompt
healthcheck:
test: ["CMD-SHELL", "pg_isready -U lynxprompt_support"]
interval: 10s
timeout: 5s
retries: 5
deploy:
resources:
limits:
memory: 512M
reservations:
memory: 128M
security_opt:
- no-new-privileges:true
# ==========================================================================
# LYNXPROMPT APPLICATION
# ==========================================================================
app:
build:
context: .
dockerfile: Dockerfile
container_name: lynxprompt-app
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "3"
depends_on:
postgres-app:
condition: service_healthy
postgres-users:
condition: service_healthy
postgres-blog:
condition: service_healthy
postgres-support:
condition: service_healthy
deploy:
resources:
limits:
memory: 2G
cpus: "2"
reservations:
memory: 256M
security_opt:
- no-new-privileges:true
tmpfs:
- /tmp:noexec,nosuid,size=100m
ports:
- "3000:3000"
networks:
- lynxprompt
volumes:
- uploads_data:/data/uploads
environment:
# Databases — password defined once per DB, shared with Postgres containers
DB_APP_HOST: postgres-app
DB_APP_USER: lynxprompt_app
DB_APP_PASSWORD: ${POSTGRES_APP_PASSWORD:-dev_app_password_change_me}
DB_APP_NAME: lynxprompt_app
DB_USERS_HOST: postgres-users
DB_USERS_USER: lynxprompt_users
DB_USERS_PASSWORD: ${POSTGRES_USERS_PASSWORD:-dev_users_password_change_me}
DB_USERS_NAME: lynxprompt_users
DB_BLOG_HOST: postgres-blog
DB_BLOG_USER: lynxprompt_blog
DB_BLOG_PASSWORD: ${POSTGRES_BLOG_PASSWORD:-dev_blog_password_change_me}
DB_BLOG_NAME: lynxprompt_blog
DB_SUPPORT_HOST: postgres-support
DB_SUPPORT_USER: lynxprompt_support
DB_SUPPORT_PASSWORD: ${POSTGRES_SUPPORT_PASSWORD:-dev_support_password_change_me}
DB_SUPPORT_NAME: lynxprompt_support
# NextAuth
NEXTAUTH_URL: http://localhost:3000
NEXTAUTH_SECRET: ${NEXTAUTH_SECRET:?NEXTAUTH_SECRET must be set}
# OAuth (configure in .env)
GITHUB_CLIENT_ID: ${GITHUB_CLIENT_ID:-}
GITHUB_CLIENT_SECRET: ${GITHUB_CLIENT_SECRET:-}
GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID:-}
GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET:-}
# SMTP (configure in .env)
SMTP_HOST: ${SMTP_HOST:-}
SMTP_PORT: ${SMTP_PORT:-587}
SMTP_USER: ${SMTP_USER:-}
SMTP_PASSWORD: ${SMTP_PASSWORD:-}
SMTP_FROM: ${SMTP_FROM:-noreply@localhost}
SMTP_FROM_NAME: ${SMTP_FROM_NAME:-LynxPrompt}
# Cloudflare Turnstile (configure in .env)
NEXT_PUBLIC_TURNSTILE_SITE_KEY: ${NEXT_PUBLIC_TURNSTILE_SITE_KEY:-}
TURNSTILE_SECRET_KEY: ${TURNSTILE_SECRET_KEY:-}
# Anthropic API for AI features (configure in .env)
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY:-}
AI_MODEL: ${AI_MODEL:-claude-3-5-haiku-latest}
# Analytics
UMAMI_SCRIPT_URL: ${UMAMI_SCRIPT_URL:-}
NEXT_PUBLIC_UMAMI_WEBSITE_ID: ${NEXT_PUBLIC_UMAMI_WEBSITE_ID:-}
# Feature flags
ENABLE_GITHUB_OAUTH: ${ENABLE_GITHUB_OAUTH:-false}
ENABLE_GOOGLE_OAUTH: ${ENABLE_GOOGLE_OAUTH:-false}
ENABLE_EMAIL_AUTH: ${ENABLE_EMAIL_AUTH:-true}
ENABLE_PASSKEYS: ${ENABLE_PASSKEYS:-true}
ENABLE_TURNSTILE: ${ENABLE_TURNSTILE:-false}
ENABLE_SSO: ${ENABLE_SSO:-false}
ENABLE_USER_REGISTRATION: ${ENABLE_USER_REGISTRATION:-true}
ENABLE_AI: ${ENABLE_AI:-false}
ENABLE_BLOG: ${ENABLE_BLOG:-false}
ENABLE_SUPPORT_FORUM: ${ENABLE_SUPPORT_FORUM:-false}
# Branding
APP_NAME: ${APP_NAME:-LynxPrompt}
APP_URL: ${APP_URL:-http://localhost:3000}
APP_LOGO_URL: ${APP_LOGO_URL:-}
# App
NODE_ENV: ${NODE_ENV:-development}
SUPERADMIN_EMAIL: ${SUPERADMIN_EMAIL:-}
UPLOAD_DIR: /data/uploads/blog
volumes:
postgres_app_data:
postgres_users_data:
postgres_blog_data:
postgres_support_data:
uploads_data:
networks:
lynxprompt:
name: lynxprompt-network