From 6473d7108be1f0d6c082d09becbc75059372297a Mon Sep 17 00:00:00 2001 From: "Dev (Paperclip)" Date: Tue, 24 Nov 2026 20:57:12 +0000 Subject: [PATCH] ci: Image-Workflow baut docker/Dockerfile wie Compose; KC_HOSTNAME folgt KEYCLOAK_PORT Refs #15 Co-Authored-By: Claude Sonnet 5.5 --- .gitea/workflows/image.yml | 10 ++-------- FORK.md | 17 ++++++++++------- docker-compose.override.yml | 4 ++-- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/.gitea/workflows/image.yml b/.gitea/workflows/image.yml index c1992355..e0522599 100644 --- a/.gitea/workflows/image.yml +++ b/.gitea/workflows/image.yml @@ -1,5 +1,5 @@ # Container-Image bauen und in die Gitea-Container-Registry pushen (Gitea #4, FLW-82). -# Baut das unveränderte Upstream-Dockerfile nach +# Baut docker/Dockerfile (wie Compose, mit docker/Dockerfile.dockerignore) nach # git.morlana.online/f.weber/homebrewery-oidc # Tags: # push auf main -> :main, :sha-<7 Zeichen> @@ -72,13 +72,6 @@ jobs: } >> "$GITHUB_OUTPUT" echo "Tags: ${names}" - # Das Upstream-Dockerfile kopiert config/docker.json (gitignoriert) und bricht ohne - # sie ab. Leeres Objekt statt echter Werte: Konfiguration kommt zur Laufzeit über - # Env-Variablen (nconf: argv > env > config/docker.json > config/default.json) oder - # eine gemountete config/docker.json. So landen keine Secrets im Image. - - name: Leere config/docker.json für das Upstream-Dockerfile - run: test -e config/docker.json || echo '{}' > config/docker.json - - uses: docker/setup-buildx-action@v4 - uses: docker/login-action@v4 @@ -91,6 +84,7 @@ jobs: uses: docker/build-push-action@v7 with: context: . + file: docker/Dockerfile # Repo-Variable IMAGE_PLATFORMS; Ziel ist linux/amd64. platforms: ${{ vars.IMAGE_PLATFORMS || 'linux/amd64' }} push: true diff --git a/FORK.md b/FORK.md index f3b75a47..85bcce7d 100644 --- a/FORK.md +++ b/FORK.md @@ -77,14 +77,17 @@ merges remain conflict-free. | Workflow | Trigger | What it does | | --- | --- | --- | | `ci.yml` | pull requests, push to `main` | `npm ci` (includes the Vite build via `postinstall`), `npm run lint:dry`, `npm run stylelint:dry`, `npm test`. Upstream currently has ESLint warnings but no errors; warnings do not fail the job. The tests need no MongoDB. | -| `image.yml` | push to `main`, tags `v*`, manual | builds the unchanged upstream `Dockerfile` and pushes `git.morlana.online/f.weber/homebrewery-oidc` | +| `image.yml` | push to `main`, tags `v*`, manual | builds `docker/Dockerfile` (same as Compose) and pushes `git.morlana.online/f.weber/homebrewery-oidc` | -The upstream `Dockerfile` copies the git-ignored `config/docker.json` and fails without -it. `image.yml` therefore creates it as `{}` before building, so no configuration or -secret is baked into the image. Configure the container at runtime through environment -variables (for example `MONGODB_URI`, `NODE_ENV=docker` is preset) or by mounting -`config/docker.json`; `server/config.js` reads argv, then env, then that file, then -`config/default.json`. The container exits if MongoDB is unreachable. +The authoritative image definition is `docker/Dockerfile` with +`docker/Dockerfile.dockerignore` (BuildKit picks it up automatically for `context: .`). +Compose (`docker-compose.override.yml`) builds the same file, so the published registry +image matches the one built locally. The upstream `Dockerfile` stays unchanged and is not +used by the fork. No configuration or secret is baked into the image: configure the +container at runtime through environment variables (for example `MONGODB_URI`; +`NODE_ENV=docker` is preset) or by mounting `config/docker.json`; `server/config.js` +reads argv, then env, then that file, then `config/default.json`. The container exits if +MongoDB is unreachable. Image tags: diff --git a/docker-compose.override.yml b/docker-compose.override.yml index b0dc651f..809b574b 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -47,8 +47,8 @@ services: KC_BOOTSTRAP_ADMIN_USERNAME: ${KEYCLOAK_ADMIN:-admin} KC_BOOTSTRAP_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD:-admin-dev} KC_HTTP_PORT: ${KEYCLOAK_PORT:-8080} - # Einheitlicher Issuer für Browser (Host) und App-Container: http://keycloak.localhost:8080 - KC_HOSTNAME: http://keycloak.localhost:8080 + # Einheitlicher Issuer für Browser (Host) und App-Container: http://keycloak.localhost: + KC_HOSTNAME: http://keycloak.localhost:${KEYCLOAK_PORT:-8080} volumes: - ./docker/keycloak/realm-homebrewery.json:/opt/keycloak/data/import/realm-homebrewery.json:ro ports: -- 2.54.1