-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
66 lines (64 loc) · 2.66 KB
/
docker-compose.yml
File metadata and controls
66 lines (64 loc) · 2.66 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
services:
md-tree:
build:
context: .
dockerfile: Dockerfile
container_name: mdedit-io
restart: unless-stopped
ports:
- "3210:3210"
volumes:
# Persist SQLite database
- ./data:/app/data
# Demo reference documents for the welcome-screen sample loader
- ./docs/examples:/app/docs/examples:ro
# Optional: Mount public folder for easier updates
- ./public:/app/public:ro
environment:
- NODE_ENV=production
- PORT=3210
# IMPORTANT: Set a secure COOKIE_SECRET in production!
# Generate with: openssl rand -hex 32
# If left empty, a random secret is generated and persisted to ./data/.cookie_secret
- COOKIE_SECRET=${COOKIE_SECRET:-}
# Performance tuning
- RATE_LIMIT_MAX=${RATE_LIMIT_MAX:-300}
- MAX_PASTES_PER_SESSION=${MAX_PASTES_PER_SESSION:-100}
- MAX_CONCURRENT_EXPORTS=${MAX_CONCURRENT_EXPORTS:-3}
- ENABLE_STATS_PAGE=${ENABLE_STATS_PAGE:-1}
# Cleanup: delete sessions/pastes inactive for this many days (default 180)
- SESSION_TTL_DAYS=${SESSION_TTL_DAYS:-180}
# Storage quotas and disk-aware cleanup
- USER_QUOTA_MB=${USER_QUOTA_MB:-50} # Max markdown size per user session
- DISK_WARN_PERCENT=${DISK_WARN_PERCENT:-10} # Medium cleanup when free disk falls to 10% or less
- DISK_CRITICAL_PERCENT=${DISK_CRITICAL_PERCENT:-5} # Aggressive cleanup and write blocking at 5% free or less
- DISK_MIN_FREE_MB=${DISK_MIN_FREE_MB:-1024} # Absolute minimum free space before writes are rejected
- MAX_PASTES_MEDIUM=${MAX_PASTES_MEDIUM:-200} # Limit per session when free disk is low
- MAX_PASTES_AGGRESSIVE=${MAX_PASTES_AGGRESSIVE:-50} # Stricter limit per session when free disk is critical
# Image upload settings
- IMAGE_MAX_SIZE_MB=${IMAGE_MAX_SIZE_MB:-10} # Max size per single image in MB
- IMAGE_MAX_TOTAL_MB=${IMAGE_MAX_TOTAL_MB:-50} # Max total image storage per paste in MB
# AI features (optional)
- DEFAULT_AI_PROVIDER=${DEFAULT_AI_PROVIDER:-groq}
- DEFAULT_AI_MODEL=${DEFAULT_AI_MODEL:-llama-3.3-70b-versatile}
- GROQ_API_KEY=${GROQ_API_KEY:-}
- GEMINI_API_KEY=${GEMINI_API_KEY:-}
healthcheck:
test: ["CMD", "node", "-e", "require('http').get('http://localhost:3210/api/pastes', (r) => process.exit(r.statusCode === 200 ? 0 : 1))"]
interval: 30s
timeout: 3s
start_period: 10s
retries: 3
networks:
- md-network
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
networks:
md-network:
driver: bridge
volumes:
md-data:
driver: local