From 7acf7bcca9222cb71cf283859f9a0d873346dcc2 Mon Sep 17 00:00:00 2001 From: "Troll (Hermes Agent)" Date: Fri, 31 Jul 2026 19:51:38 +0000 Subject: [PATCH] Switch deployment target from Unraid to Portainer; update docker-compose and docs --- README.md | 38 +++++++++++++++++++++++++++++--------- docker-compose.yml | 14 +++++++++++--- 2 files changed, 40 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 72740b1..2eb4ab7 100644 --- a/README.md +++ b/README.md @@ -30,15 +30,35 @@ Generate an admin password hash with: .venv/bin/python -c "from werkzeug.security import generate_password_hash; print(generate_password_hash('yourpassword'))" ``` -## Deployment on Unraid +## Deployment with Portainer -1. Copy the project directory to your Unraid server or build it via git. -2. Create `/mnt/user/appdata/theme-song-booth/data` and `/mnt/user/appdata/theme-song-booth/uploads`. -3. Copy `.env.example` to `.env`, fill in real values, and place it next to `docker-compose.yml`. -4. Run `docker compose up -d --build`. -5. Initialize the database once: `docker compose exec booth python init_db.py`. -6. Point your chosen domain at the Unraid server's public IP and route it through your reverse proxy to `http://127.0.0.1:8000`. -7. Print the booth QR code pointing to `https://your-domain.example.com/request`. +The repo includes a `docker-compose.yml` that builds directly from GitLab, so Portainer can pull and deploy it as a stack. + +1. Log in to your Portainer instance. +2. Go to **Stacks** → **Add stack**. +3. Choose **Repository** and paste: + - URL: `https://gitlab.hallsworth.ca/yrtria/theme-song-booth.git` + - Branch: `main` + - Compose path: `docker-compose.yml` +4. Add environment variables in Portainer (or upload a `.env` file): + - `APP_SECRET_KEY` + - `ADMIN_PASSWORD_HASH` + - `SMTP_PASS` + - `PUBLIC_BASE_URL` (your HTTPS domain) + - `ADMIN_ALERT_EMAIL` +5. Deploy the stack. +6. Open a console into the `booth` container and run once: + ```bash + python init_db.py + ``` +7. Point your reverse proxy (Nginx Proxy Manager, Traefik, Caddy, etc.) at `http://host-ip:8000` on the chosen domain. +8. Print the booth QR code pointing to `https://your-domain/request`. + +### Portainer Notes + +- The `docker-compose.yml` uses named volumes (`booth-data`, `booth-uploads`) so Portainer handles persistence automatically. +- For a pre-built image instead of repo build, replace the `build:` block with an `image:` line pointing to your registry. +- Update the stack after each push to redeploy the latest code. ## Files @@ -47,4 +67,4 @@ Generate an admin password hash with: - `config.py` — Configuration loaded from environment. - `templates/` — Jinja2 HTML templates. - `init_db.py` — Standalone script to create the SQLite database. -- `Dockerfile` / `docker-compose.yml` — Container packaging for Unraid. +- `Dockerfile` / `docker-compose.yml` — Container packaging for Portainer. diff --git a/docker-compose.yml b/docker-compose.yml index d4c6ed3..1fa2acf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,11 +1,19 @@ services: booth: - build: . + # Option A: use a pre-built image (push this from CI or build locally and tag) + # image: registry.gitlab.hallsworth.ca/yrtria/theme-song-booth:latest + # Option B: build directly from the GitLab repo in Portainer + build: + context: https://gitlab.hallsworth.ca/yrtria/theme-song-booth.git#main container_name: theme-song-booth restart: unless-stopped env_file: .env ports: - "127.0.0.1:8000:8000" volumes: - - /mnt/user/appdata/theme-song-booth/data:/app/data - - /mnt/user/appdata/theme-song-booth/uploads:/app/uploads + - booth-data:/app/data + - booth-uploads:/app/uploads + +volumes: + booth-data: + booth-uploads: