Switch deployment target from Unraid to Portainer; update docker-compose and docs
This commit is contained in:
parent
c16d48ee32
commit
7acf7bcca9
2 changed files with 40 additions and 12 deletions
38
README.md
38
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.
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
Reference in a new issue