From f803541ba0bfce16c8b4e7faf65768700001338c Mon Sep 17 00:00:00 2001 From: Florian Weber Date: Fri, 27 Jun 2025 14:19:04 +0200 Subject: [PATCH] Update build workflow and README for Docker image configuration and registry logins --- .gitea/workflows/build.yaml | 30 +++++++- README.md | 136 +++++++++++++++++++++++++++++++++++- 2 files changed, 162 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 3906e45..f8fdeb6 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -24,12 +24,24 @@ jobs: token: ${{ secrets.GH_TOKEN }} path: homebrewery - - name: Login to GitHub Container Registry + - name: Login to Gitea Container Registry uses: docker/login-action@v3 with: registry: git.morlana.online username: ${{ github.repository_owner }} password: ${{ secrets.DOCKER_TOKEN }} + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Login to Morlana Container Registry + uses: docker/login-action@v3 + with: + username: ${{ secrets.MORLANA_DOCKER_USER }} + password: ${{ secrets.MORLANA_DOCKER_PASSWORD }} - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -55,3 +67,19 @@ jobs: tags: | git.morlana.online/${{ github.repository_owner }}/homebrewery:latest git.morlana.online/${{ github.repository_owner }}/homebrewery:${{ github.event.release.tag_name }} + reg.morlana.net/homebrewery:latest + reg.morlana.net/homebrewery:${{ github.event.release.tag_name }} + kosmos367/homebrewery:latest + kosmos367/homebrewery:${{ github.event.release.tag_name }} + + update-description: + runs-on: ubuntu-24.04 + + steps: + + - name: Docker Hub Description + uses: peter-evans/dockerhub-description@v4 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + repository: peterevans/dockerhub-description diff --git a/README.md b/README.md index 4718830..cbb5ee2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,134 @@ -# homebrewery-docker +# Homebrewery (Unofficial) Docker Image -Create authentic looking D&D homebrews using only markdown. -This is an automatic build of the docker image from official repository at: https://github.com/naturalcrit/homebrewery \ No newline at end of file +An unofficial, prebuilt Docker image for [NaturalCrit’s Homebrewery](https://github.com/naturalcrit/homebrewery), with sensible defaults and full configuration via environment variables. Published to Docker Hub and mirrored on my Gitea instance to avoid Docker Hub pull-rate limits. + +--- + +## Features + +- **Prebuilt image** based on `node:22-alpine` +- Auto-fetches and builds the latest Homebrewery release (tags mirror upstream) +- Configure entirely via **environment variables**—no need to mount a JSON file +- Optional mounting of custom images/fonts + +--- + +## Image Names & Tags + +- **Docker Hub**: `kosmos367/homebrewery` +- **Gitea Registry**: `git.morlana.online/f.weber/homebrewery` +- **Tags**: Mirror upstream releases (e.g. `v3.14.3`, `v3.15.0`, …). Updated twice daily. + +--- + +## Environment Variables + +| Variable | Default | Description | +| ---------------------- | ---------------------------------------- | -------------------------------- | +| `NODE_ENV` | `docker` | Node environment | +| `PORT` | `8000` | Port on which Homebrewery serves | +| `HB_HOST` | `homebrewery.local.naturalcrit.com:8000` | Hostname for generated config | +| `HB_NATURALCRIT_URL` | `local.naturalcrit.com:8010` | Base URL of NaturalCrit site | +| `HB_SECRET` | `secret` | Session secret | +| `HB_ENABLE_V3` | `true` | Enable v3 editor mode | +| `HB_ENABLE_THEMES` | `true` | Enable theming support | +| `HB_PUBLIC_URL` | `https://homebrewery.naturalcrit.com` | Public URL for links | +| `HB_LOCAL_ENVIRONMENT` | `docker` | Local environment tag | +| `HB_DB_URI` | `mongodb://mongodb/homebrewery` | MongoDB connection URI | +| `HB_IMAGES` | `null` | Path for static images | +| `HB_FONTS` | `null` | Path for static fonts | + +> **Tip**: If you prefer, mount your own JSON config at `/usr/src/app/config/docker.json` instead of using env vars. + +--- + +## Exposed Ports & Volumes + +- **Port**: `8000/tcp` (or as set via `PORT`) +- **Optional volumes**: + + - `/usr/src/app/images` (use with `HB_IMAGES`) + - `/usr/src/app/fonts` (use with `HB_FONTS`) + - Data persistence is handled via MongoDB. + +--- + +## Example: `docker-compose.yml` + +```yaml +version: "3.8" +services: + homebrewery: + image: kosmos367/homebrewery:latest + container_name: homebrewery + environment: + HB_HOST: "homebrewery.example.com" + HB_SECRET: "your-secret-key" + HB_PUBLIC_URL: "https://homebrewery.example.com" + HB_DB_URI: "mongodb://mongo:27017/homebrewery" + # Optional mounts: + # HB_IMAGES: '/usr/src/app/images' + # HB_FONTS: '/usr/src/app/fonts' + ports: + - "8000:8000" + # Optional volumes for customization + #volumes: + # - images-data:/usr/src/app/images + # - fonts-data:/usr/src/app/fonts + depends_on: + - mongo + + mongo: + image: mongo:latest + container_name: homebrewery-db + volumes: + - mongo-data:/data/db + +volumes: + mongo-data: + # Optional volumes for customization + # images-data: + # fonts-data: +``` + +--- + +## Repository & Registry Links + +- **Gitea repository** (Dockerfile, CI/CD, etc.): + [https://git.morlana.online/f.weber/homebrewery-docker](https://git.morlana.online/f.weber/homebrewery-docker) +- **Gitea Docker registry**: + [https://git.morlana.online/f.weber/homebrewery-docker/packages](https://git.morlana.online/f.weber/homebrewery-docker/packages) +- **Upstream Homebrewery**: + [https://github.com/naturalcrit/homebrewery](https://github.com/naturalcrit/homebrewery) + +**Pull example for all available registries:** + +```bash +docker pull kosmos367/homebrewery + +docker pull git.morlana.online/f.weber/homebrewery + +docker pull reg.morlana.net/homebrewery +``` + +--- + +## Maintainer + +Florian Weber ‹[kosmos@morlana.net](mailto:kosmos@morlana.net)› + +--- + +## License + +This Docker wrapper is released under the **MIT License**, same as the original Homebrewery project. + +--- + +> ⚠️ **Disclaimer** +> This is **not** an official Homebrewery image. It is provided “as-is” with no affiliation to NaturalCrit. Use at your own risk. + +--- + +Feel free to suggest tweaks or additional sections—happy to refine!