Update example Docker Compose file to reflect current setup (#1115)
This commit is contained in:
@@ -1,32 +0,0 @@
|
|||||||
# Docker Image Version
|
|
||||||
# This determines which version of the Booklore image to pull from GitHub Container Registry (GHCR).
|
|
||||||
# Use "latest" for the most recent version or specify a tag like "v1.0.0".
|
|
||||||
BOOKLORE_IMAGE_TAG=latest
|
|
||||||
|
|
||||||
# User and Timezone Settings
|
|
||||||
# USER_ID and GROUP_ID define the user/group running the backend service.
|
|
||||||
# Avoid using "user" property because system won't work with it.
|
|
||||||
# TZ sets the timezone for correct time-related operations.
|
|
||||||
USER_ID=0 # Default root user ID (Check with `id -u` on Linux/Mac)
|
|
||||||
GROUP_ID=0 # Default root group ID (Check with `id -g` on Linux/Mac)
|
|
||||||
TZ=Etc/UTC # Change this to your timezone (e.g., America/New_York, Asia/Kolkata)
|
|
||||||
|
|
||||||
# Database Credentials (Replace with a secure password)
|
|
||||||
# This password is used by MariaDB. Make sure to keep it secure.
|
|
||||||
MYSQL_ROOT_PASSWORD=super_secure_password
|
|
||||||
MYSQL_DATABASE=booklore
|
|
||||||
MYSQL_USER=booklore
|
|
||||||
MYSQL_PASSWORD=your_secure_password
|
|
||||||
|
|
||||||
# Paths for Docker Volumes (Update these paths as per your system)
|
|
||||||
# These paths store persistent data for Booklore and MariaDB.
|
|
||||||
# Replace "/path/to/..." with actual directories on your system.
|
|
||||||
BOOKLORE_DATA_PATH=/path/to/booklore/data # Example: /home/user/booklore/data (Stores app-related data)
|
|
||||||
BOOKLORE_BOOKS_PATH=/path/to/booklore/books # Example: /home/user/booklore/books (Stores book files)
|
|
||||||
MARIADB_CONFIG_PATH=/path/to/mariadb/config # Example: /home/user/booklore/mariadb/config (Stores database config)
|
|
||||||
|
|
||||||
# How to find your correct paths?
|
|
||||||
# 1. Choose a location where you want to store persistent data.
|
|
||||||
# 2. Create the required folders if they don’t exist.
|
|
||||||
# 3. Use `pwd` in your terminal inside those directories to get the full path.
|
|
||||||
# 4. Replace `/path/to/...` above with your actual paths.
|
|
||||||
@@ -1,33 +1,48 @@
|
|||||||
name: booklore
|
|
||||||
services:
|
services:
|
||||||
booklore:
|
booklore:
|
||||||
image: booklore/booklore:${BOOKLORE_IMAGE_TAG}
|
# Official Docker Hub image:
|
||||||
container_name: booklore_server
|
image: booklore/booklore:latest
|
||||||
env_file:
|
# Or the GHCR image:
|
||||||
- .env
|
# image: ghcr.io/booklore-app/booklore:latest
|
||||||
|
container_name: booklore
|
||||||
environment:
|
environment:
|
||||||
- DATABASE_URL=jdbc:mariadb://mariadb:3306/${MYSQL_DATABASE}
|
- USER_ID=0 # Modify this if the volume's ownership is not root
|
||||||
- DATABASE_USERNAME=${MYSQL_USER}
|
- GROUP_ID=0 # Modify this if the volume's ownership is not root
|
||||||
- DATABASE_PASSWORD=${MYSQL_PASSWORD}
|
- TZ=Etc/UTC
|
||||||
|
- DATABASE_URL=jdbc:mariadb://mariadb:3306/booklore # Only modify this if you're familiar with JDBC and your database setup
|
||||||
|
- DATABASE_USERNAME=booklore # Must match MYSQL_USER defined in the mariadb container
|
||||||
|
- DATABASE_PASSWORD=your_secure_password # Use a strong password; must match MYSQL_PASSWORD defined in the mariadb container
|
||||||
|
- BOOKLORE_PORT=6060 # Port BookLore listens on inside the container; must match container port below
|
||||||
|
- SWAGGER_ENABLED=false # Enable or disable Swagger UI (API docs). Set to 'true' to allow access; 'false' to block access (recommended for production).
|
||||||
depends_on:
|
depends_on:
|
||||||
mariadb:
|
mariadb:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
ports:
|
ports:
|
||||||
- "6060:6060"
|
- "6060:6060" # HostPort:ContainerPort → Keep both numbers the same, and also ensure the container port matches BOOKLORE_PORT, no exceptions.
|
||||||
|
# All three (host port, container port, BOOKLORE_PORT) must be identical for BookLore to function properly.
|
||||||
|
# Example: To expose on host port 7070, set BOOKLORE_PORT=7070 and use "7070:7070".
|
||||||
volumes:
|
volumes:
|
||||||
- ${BOOKLORE_DATA_PATH}:/app/data
|
- ./data:/app/data # Application data (settings, metadata, cache, etc.). Persist this folder to retain your library state across container restarts.
|
||||||
- ${BOOKLORE_BOOKS_PATH}:/books
|
- ./books:/books # Primary book library folder. Mount your collection here so BookLore can access and organize your books.
|
||||||
|
- ./bookdrop:/bookdrop # BookDrop folder. Files placed here are automatically detected and prepared for import.
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
mariadb:
|
mariadb:
|
||||||
image: lscr.io/linuxserver/mariadb:11.4.5
|
image: lscr.io/linuxserver/mariadb:11.4.5
|
||||||
container_name: booklore_mariadb
|
container_name: mariadb
|
||||||
env_file:
|
environment:
|
||||||
- .env
|
- PUID=1000
|
||||||
|
- PGID=1000
|
||||||
|
- TZ=Etc/UTC
|
||||||
|
- MYSQL_ROOT_PASSWORD=super_secure_password # Use a strong password for the database's root user, should be different from MYSQL_PASSWORD
|
||||||
|
- MYSQL_DATABASE=booklore
|
||||||
|
- MYSQL_USER=booklore # Must match DATABASE_USERNAME defined in the booklore container
|
||||||
|
- MYSQL_PASSWORD=your_secure_password # Use a strong password; must match DATABASE_PASSWORD defined in the booklore container
|
||||||
volumes:
|
volumes:
|
||||||
- ${MARIADB_CONFIG_PATH}:/config
|
- ./config:/config
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "mariadb-admin", "ping", "-h", "localhost"]
|
test: [ "CMD", "mariadb-admin", "ping", "-h", "localhost" ]
|
||||||
interval: 10s
|
interval: 5s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 5
|
retries: 10
|
||||||
Reference in New Issue
Block a user