-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
91 lines (74 loc) · 2.44 KB
/
Copy pathdocker-compose.yml
File metadata and controls
91 lines (74 loc) · 2.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
# BookShelf Docker Compose Configuration
# https://github.com/iamernie/BookShelf
#
# Quick Start:
# 1. Copy .env.example to .env and configure your settings
# 2. Run: docker-compose up -d
# 3. Access BookShelf at http://localhost:3000
#
# For GHCR image, use:
# docker-compose -f docker-compose.yml up -d
#
# FILE PERMISSIONS:
# Set PUID/PGID to match your host user for proper file ownership:
# - Run 'id' to find your UID/GID
# - Set PUID and PGID in your .env file or environment
services:
bookshelf:
# Use the GitHub Container Registry image
image: ghcr.io/iamernie/bookshelf:latest
# Or build locally:
# build: .
container_name: bookshelf-v2
restart: unless-stopped
ports:
- "${PORT:-3000}:3000"
environment:
# Required: Session secret (generate with: openssl rand -hex 32)
- SESSION_SECRET=${SESSION_SECRET:?SESSION_SECRET is required}
# Optional: Node environment
- NODE_ENV=${NODE_ENV:-production}
# Optional: Port (default 3000)
- PORT=3000
# Required for SvelteKit in production
- ORIGIN=${ORIGIN:-http://localhost:3000}
# Body size limit for uploads (default 512KB is too small for ebooks/audiobooks)
# Set to 500MB to allow large audiobook uploads
- BODY_SIZE_LIMIT=500M
# User/Group ID for file permissions (match your host user)
# Run 'id' on your host to find your UID/GID
- PUID=${PUID:-1000}
- PGID=${PGID:-1000}
# Database and log paths (internal to container)
- DATABASE_PATH=/data/bookshelf.sqlite
- LOG_DIR=/logs
volumes:
# Persistent data storage
# Database - stores all your book data
- bookshelf_data:/data
# Logs - application logs for debugging
- bookshelf_logs:/logs
# Covers - book cover images
- bookshelf_covers:/app/static/covers
# Ebooks - uploaded ebook files
- bookshelf_ebooks:/app/static/ebooks
# Audiobooks - uploaded audiobook files
- bookshelf_audiobooks:/data/audiobooks
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Named volumes for data persistence
volumes:
bookshelf_data:
driver: local
bookshelf_logs:
driver: local
bookshelf_covers:
driver: local
bookshelf_ebooks:
driver: local
bookshelf_audiobooks:
driver: local