diff --git a/README.md b/README.md index 2d45e0412..55494933c 100644 --- a/README.md +++ b/README.md @@ -91,54 +91,70 @@ Ensure you have [Docker](https://docs.docker.com/get-docker/) and [Docker Compos > **Note:** Legacy images under `https://ghcr.io/adityachandelgit/booklore-app` will remain available but will not receive new updates. -### 2️⃣ Create docker-compose.yml +### 2️⃣ Set Up Your docker-compose.yml Configuration -> ⚠️ If you intend to run the container as a non-root user, you must manually create all of your `/your/local/path/to/booklore` directories with read and write permissions for your intended user **before first run**. +**Step 1: Create a `.env` file** in the same directory as your `docker-compose.yml`: -Create a `docker-compose.yml` file with content: +```ini +# BookLore Application Settings +APP_USER_ID=0 +APP_GROUP_ID=0 +TZ=Etc/UTC +BOOKLORE_PORT=6060 + +# Database Connection (BookLore) +DATABASE_URL=jdbc:mariadb://mariadb:3306/booklore +DB_USER=booklore +DB_PASSWORD=ChangeMe_BookLoreApp_2025! + +# MariaDB Container Settings +DB_USER_ID=1000 +DB_GROUP_ID=1000 +MYSQL_ROOT_PASSWORD=ChangeMe_MariaDBRoot_2025! +MYSQL_DATABASE=booklore +``` + +**Step 2: Create a `docker-compose.yml` file** that references the `.env` variables: ```yaml services: booklore: - # Official Docker Hub image: image: booklore/booklore:latest - # Or the GHCR image: + # Alternative: Use GitHub Container Registry # image: ghcr.io/booklore-app/booklore:latest container_name: booklore environment: - - USER_ID=0 - - GROUP_ID=0 - - TZ=Etc/UTC - - DATABASE_URL=jdbc:mariadb://mariadb:3306/booklore - - DATABASE_USERNAME=booklore # Must match MYSQL_USER defined in the mariadb container - - DATABASE_PASSWORD=your_secure_password - - BOOKLORE_PORT=6060 # Port BookLore listens on inside the container; must match container port below + - USER_ID=${APP_USER_ID} + - GROUP_ID=${APP_GROUP_ID} + - TZ=${TZ} + - DATABASE_URL=${DATABASE_URL} + - DATABASE_USERNAME=${DB_USER} + - DATABASE_PASSWORD=${DB_PASSWORD} + - BOOKLORE_PORT=${BOOKLORE_PORT} depends_on: mariadb: condition: service_healthy ports: - - "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". + - "${BOOKLORE_PORT}:${BOOKLORE_PORT}" volumes: - - /your/local/path/to/booklore/data:/app/data # Application data (settings, metadata, cache, etc.). Persist this folder to retain your library state across container restarts. - - /your/local/path/to/booklore/books:/books # Primary book library folder. Mount your collection here so BookLore can access and organize your books. - - /your/local/path/to/booklore/bookdrop:/bookdrop # BookDrop folder. Files placed here are automatically detected and prepared for import. + - ./data:/app/data + - ./books:/books + - ./bookdrop:/bookdrop restart: unless-stopped mariadb: image: lscr.io/linuxserver/mariadb:11.4.5 container_name: mariadb environment: - - 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 + - PUID=${DB_USER_ID} + - PGID=${DB_GROUP_ID} + - TZ=${TZ} + - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} + - MYSQL_DATABASE=${MYSQL_DATABASE} + - MYSQL_USER=${DB_USER} + - MYSQL_PASSWORD=${DB_PASSWORD} volumes: - - /your/local/path/to/mariadb/config:/config + - ./mariadb/config:/config restart: unless-stopped healthcheck: test: [ "CMD", "mariadb-admin", "ping", "-h", "localhost" ] @@ -147,9 +163,6 @@ services: retries: 10 ``` -Note: You can find the latest BookLore image tag `BOOKLORE_IMAGE_TAG` (e.g. v.0.x.x) from the Releases section: -📦 [Latest Image Tag – GitHub Releases](https://github.com/adityachandelgit/BookLore/releases) - ### 3️⃣ Start the Containers Run the following command to start the services: @@ -163,37 +176,9 @@ docker compose up -d Once the containers are up, access BookLore in your browser at: ```ini -http : //localhost:6060 +http://localhost:6060 ``` -## ⚙️ Supported Environment Variables - -### BookLore Container - -| Key | Default Value | Description | -|----------------------|----------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `USER_ID` | `0` | User ID for file ownership within the container. Set this to match your host user's UID if running as non-root (e.g., `1000`). Use `id -u` on Linux to find your UID. | -| `GROUP_ID` | `0` | Group ID for file ownership within the container. Set this to match your host user's GID if running as non-root (e.g., `1000`). Use `id -g` on Linux to find your GID. | -| `TZ` | `Etc/UTC` | Timezone for the application. Controls timestamps in logs and UI. Use standard timezone identifiers (e.g., `America/New_York`, `Europe/London`, `Asia/Tokyo`). See [List of tz database time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). | -| `DATABASE_URL` | `jdbc:mariadb://mariadb:3306/booklore` | JDBC connection string for MariaDB/MySQL database. Format: `jdbc:mariadb://hostname:port/database_name`. Only modify if using a custom database host, port, or external database server. | -| `DATABASE_USERNAME` | `booklore` | Username for database authentication. Must match `MYSQL_USER` in your MariaDB container configuration. | -| `DATABASE_PASSWORD` | - | Password for database authentication. **Required**. Use a strong, unique password. Must match `MYSQL_PASSWORD` in your MariaDB container configuration. Store securely and never commit to version control. | -| `BOOKLORE_PORT` | `6060` | Internal port BookLore listens on. **Critical**: This must match both the host and container ports in your port mapping (e.g., `6060:6060`). Changing this requires updating all three values. Example: For port `7070`, use `BOOKLORE_PORT=7070` and `7070:7070`. | -| `SWAGGER_ENABLED` | `false` | Controls access to Swagger UI for API documentation and testing. Set to `true` to enable at `/swagger-ui.html` (useful for development/testing). Keep `false` in production for security. | -| `FORCE_DISABLE_OIDC` | `false` | Forces local username/password authentication only. Set to `true` to completely disable OIDC/OAuth2 providers (Authentik, Pocket ID, etc.). Useful for troubleshooting authentication issues or temporarily bypassing external identity providers. | - -### MariaDB Container - -| Key | Default Value | Description | -|-----------------------|---------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `PUID` | `1000` | Process User ID for the LinuxServer.io MariaDB container. Set this to match your host user's UID for proper file permissions. Use `id -u` on Linux to find your UID. | -| `PGID` | `1000` | Process Group ID for the LinuxServer.io MariaDB container. Set this to match your host user's GID for proper file permissions. Use `id -g` on Linux to find your GID. | -| `TZ` | `Etc/UTC` | Timezone for the MariaDB container. Should match the BookLore container's timezone for consistency in timestamps. | -| `MYSQL_ROOT_PASSWORD` | - | Root password for the MariaDB database. **Required**. Use a strong, unique password different from `MYSQL_PASSWORD`. This provides administrative access to the database server. Never expose or commit to VCS. | -| `MYSQL_DATABASE` | `booklore` | Name of the database to create on first run. This database will be used by BookLore to store all application data. Should not be changed after initial setup. | -| `MYSQL_USER` | `booklore` | Username for the application database user. Must match `DATABASE_USERNAME` in the BookLore container configuration. This user will have full access to the `MYSQL_DATABASE`. | -| `MYSQL_PASSWORD` | - | Password for the application database user. **Required**. Use a strong, unique password. Must match `DATABASE_PASSWORD` in the BookLore container configuration. Store securely and never commit to VCS. | - ## 📥 Bookdrop Folder: Auto-Import Files BookLore now supports a **Bookdrop folder**, a special directory where you can drop your book files (`.pdf`, `.epub`, `.cbz`, etc.), and BookLore will automatically detect, process, and prepare them for import. This makes it easy to bulk add new books without manually uploading each one. @@ -214,9 +199,9 @@ services: booklore: ... volumes: - - /your/local/path/to/booklore/data:/app/data - - /your/local/path/to/booklore/books:/books - - /your/local/path/to/booklore/bookdrop:/bookdrop # 👈 Bookdrop directory + - ./data:/app/data + - ./books:/books + - ./bookdrop:/bookdrop # 👈 Bookdrop directory ``` ## 🔑 OIDC/OAuth2 Authentication (Authentik, Pocket ID, etc.)