ci: Ein Image-Weg – CI baut docker/Dockerfile wie Compose #16

Merged
archimedes-bot Bot merged 1 commits from flw-179-one-image-path into main 2026-11-25 08:07:13 +00:00
3 changed files with 14 additions and 17 deletions

No files matched your search

+2 -8
View File
@@ -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
+10 -7
View File
@@ -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:
+2 -2
View File
@@ -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:<KEYCLOAK_PORT>
KC_HOSTNAME: http://keycloak.localhost:${KEYCLOAK_PORT:-8080}
volumes:
- ./docker/keycloak/realm-homebrewery.json:/opt/keycloak/data/import/realm-homebrewery.json:ro
ports: