-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
75 lines (70 loc) · 3.07 KB
/
Copy pathdocker-compose.yml
File metadata and controls
75 lines (70 loc) · 3.07 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
# =============================================================================
# BibleLM — Docker Compose (self-hosted stack)
#
# Usage:
# cp .env.example .env.local # fill in API keys
# docker compose up --build # first run: builds image
# docker compose up # subsequent runs (uses cache)
# docker compose down # stop
#
# Services:
# biblelm — Next.js app (port 3000)
# redis — Optional Upstash-compatible Redis for rate limiting / caching
# Remove this service if you rely on the Upstash cloud.
# =============================================================================
services:
# ---------------------------------------------------------------------------
# BibleLM Next.js application
# ---------------------------------------------------------------------------
biblelm:
build:
context: .
dockerfile: Dockerfile
image: biblelm:latest
container_name: biblelm
restart: unless-stopped
ports:
- "3000:3000"
environment:
# ── LLM Providers ──────────────────────────────────────────────────────
GROQ_API_KEY: ${GROQ_API_KEY}
HUGGINGFACE_API_KEY: ${HUGGINGFACE_API_KEY:-}
# ── Rate Limiting / Caching ─────────────────────────────────────────────
# Point at the local redis service defined below.
# Override with Upstash cloud credentials if you prefer the managed service.
UPSTASH_REDIS_REST_URL: ${UPSTASH_REDIS_REST_URL:-http://redis:8079}
UPSTASH_REDIS_REST_TOKEN: ${UPSTASH_REDIS_REST_TOKEN:-local-dev-token}
# ── Runtime ────────────────────────────────────────────────────────────
NODE_ENV: production
PORT: 3000
depends_on:
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:3000/api/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
# ---------------------------------------------------------------------------
# Local Redis (Upstash-compatible REST gateway via upstash/redis-local)
# Provides distributed rate limiting and response caching without needing
# a paid Upstash account in self-hosted mode.
# ---------------------------------------------------------------------------
redis:
image: redis:7-alpine
container_name: biblelm-redis
restart: unless-stopped
# Persist data across restarts so the response cache survives container
# recreation. Remove the volume mount to run fully ephemeral.
volumes:
- redis_data:/data
command: redis-server --save 60 1 --loglevel warning
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
volumes:
redis_data:
driver: local