ci: Image-Workflow baut docker/Dockerfile wie Compose; KC_HOSTNAME folgt KEYCLOAK_PORT
CI / App (npm ci + Build, ESLint, Stylelint, Jest) (pull_request) Successful in 1m18s
CI / App (npm ci + Build, ESLint, Stylelint, Jest) (pull_request) Successful in 1m18s
Refs #15 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0880870a9f
commit
6473d7108b
3 files changed
+14
-17
No files matched your search
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user