forked from masonfox/tome
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
45 lines (43 loc) · 1.54 KB
/
Copy pathdocker-compose.yml
File metadata and controls
45 lines (43 loc) · 1.54 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
version: '3.8'
services:
# ⚠️ WARNING: DO NOT SCALE THIS SERVICE ⚠️
#
# This service runs database migrations on startup. Running multiple
# instances simultaneously will cause race conditions and potential
# data corruption.
#
# DO NOT RUN: docker-compose up --scale tome=3
#
# While the migration system has locking to prevent concurrent execution,
# SQLite's file-based locking may not be reliable across all volume
# mount types (especially network mounts like NFS).
#
# For high availability:
# - Use blue-green deployment strategy
# - Run migrations as a separate step before deployment
# - Use a single instance with proper health checks
#
tome:
build: .
ports:
- "3000:3000"
environment:
- NODE_ENV=production
- CALIBRE_DB_PATH=/calibre/metadata.db
volumes:
# Persist SQLite database
# NOTE: The container runs as user 'nextjs' (UID 1001)
# On first run, the entrypoint will ensure the directory is writable
# If you encounter permission errors, you can either:
# 1. Let the container handle permissions (recommended)
# 2. Or run with: docker-compose run --user 1001:1001 tome
- tome-data:/app/data
# Mount your Calibre library (read-write for rating sync)
# Replace with your actual Calibre library path
- ./calibre-library:/calibre
restart: unless-stopped
volumes:
tome-data:
driver: local
# Volume will be created with default permissions
# The entrypoint script ensures proper permissions on first run