From 6ee4087dfd584c0750d8dd4afbda02af4da57c60 Mon Sep 17 00:00:00 2001 From: nocci Date: Sun, 7 Dec 2025 12:22:53 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20docs(README):=20update=20Docker?= =?UTF-8?q?=20Compose=20quickstart=20instructions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - use included docker-compose.yml for setup - streamline update process with docker-compose pull ♻️ refactor(docker-compose): use prebuilt image and env_file - switch to prebuilt GHCR image in docker-compose.yml - utilize env_file for environment variables - reorder ports configuration for clarity --- README.md | 21 ++++++--------------- docker-compose.yml | 22 ++++++++++------------ 2 files changed, 16 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index dbecac2..66b0989 100644 --- a/README.md +++ b/README.md @@ -22,27 +22,18 @@ Self-hosted overview for rented servers (VPS, dedicated, storage, managed). Mult - Pull directly with `docker pull ghcr.io/nocci-sl/fleetledger:latest`. ## Quickstart with Docker Compose (prebuilt image) -Use the published GHCR image; no local build needed. +Use the included `docker-compose.yml` with the published GHCR image; no local build needed. ```bash cp .env-example .env # set SESSION_SECRET in .env to a strong random value - -cat > docker-compose.override.yml <<'EOF' -services: - fleetledger: - image: ghcr.io/nocci-sl/fleetledger:latest - environment: - SESSION_SECRET: ${SESSION_SECRET:?set in .env} - SESSION_COOKIE_SECURE: ${SESSION_COOKIE_SECURE:-1} - ENCRYPTION_KEY: ${ENCRYPTION_KEY:-} - ALLOW_SELF_REGISTRATION: ${ALLOW_SELF_REGISTRATION:-0} - volumes: - - ./data:/app/data -EOF - docker-compose up -d ``` SQLite will live on the host in `./data/fleetledger.db`. +To update, pull the latest image and recreate: +```bash +docker-compose pull +docker-compose up -d +``` ## Quickstart with Docker (build locally) ```bash diff --git a/docker-compose.yml b/docker-compose.yml index 191157e..a698a1a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,19 +1,17 @@ services: fleetledger: - build: . + image: ghcr.io/nocci-sl/fleetledger:latest container_name: fleetledger - ports: - - "8000:8000" + env_file: + - .env environment: - - DATABASE_PATH=/app/data/fleetledger.db - # SESSION_SECRET must be provided (e.g. via .env) and should be long and random - - SESSION_SECRET=${SESSION_SECRET:?Set SESSION_SECRET in your environment} - # Set to 0 only for local HTTP testing; keep secure (default) in production - - SESSION_COOKIE_SECURE=${SESSION_COOKIE_SECURE:-1} - # Optional: encryption key for management passwords (Fernet key) - - ENCRYPTION_KEY=${ENCRYPTION_KEY:-} - # Allow self-registration after first admin (1 = allow, 0 = only admin-created) - - ALLOW_SELF_REGISTRATION=${ALLOW_SELF_REGISTRATION:-0} + SESSION_SECRET: ${SESSION_SECRET:?Set SESSION_SECRET in .env} + SESSION_COOKIE_SECURE: ${SESSION_COOKIE_SECURE:-1} + ENCRYPTION_KEY: ${ENCRYPTION_KEY:-} + ALLOW_SELF_REGISTRATION: ${ALLOW_SELF_REGISTRATION:-0} + DATABASE_PATH: ${DATABASE_PATH:-/app/data/fleetledger.db} volumes: - ./data:/app/data + ports: + - "8000:8000" restart: unless-stopped