Skip to content

build: run the admin UI from a container, like everything else - #14

Merged
PhilippTheServer merged 1 commit into
mainfrom
pl/docker-compose
Aug 26, 2026
Merged

PhilippTheServer merged 1 commit into
mainfrom
pl/docker-compose

Conversation

@PhilippTheServer

Copy link
Copy Markdown
Contributor

Closes #13

The admin UI was the only part of OpenTaberna you could not docker compose up. Now it
matches OpenTaberna/frontend exactly: Dockerfile, nginx.conf, compose.yaml,
.dockerignore, multi-stage build, nginx on 4200.

The API is now /api, not a hardcoded host

apiBaseUrl was http://localhost:8000, baked into the bundle. It is now the same-origin
path /api, mapped two ways:

  • container — nginx proxies /api/ → http://host.docker.internal:8000/, same as the storefront
  • ng serve — proxy.conf.json does the same, so npm start keeps working

Both behave identically and neither ships an API host. The Keycloak URL stays absolute,
because the browser is redirected there and a same-origin path would be meaningless.

Verification

$ npx ng test --watch=false
 Test Files  10 passed (10)
      Tests  67 passed (67)

$ docker compose up -d
$ curl -s http://localhost:4200/ | grep -o "<title>.*</title>"
<title>OpenTaberna Admin</title>

$ curl -o /dev/null -w "%{http_code}" http://localhost:4200/api/v1/items/
200
$ curl -o /dev/null -w "%{http_code}" http://localhost:4200/api/v1/admin/analytics/summary
403          ← auth still enforced through the proxy

And ng serve still reaches the API through the new dev proxy:

$ npx ng serve --port 4201
$ curl http://localhost:4201/api/v1/items/
{"success":true,"message":"Items retrieved successfully",…}

One thing I found and did not fix here

src/environments/environment.prod.ts is never referenced. angular.json has no
fileReplacements, so ng build --configuration production silently uses environment.ts
— which is why the hardcoded http://localhost:8000 mattered at all.

This change removes the immediate harm (there is no host to get wrong now), but the dead
file is still misleading: it carries a real-looking https://auth.opentaberna.de Keycloak
URL that no build has ever used. Worth either wiring up or deleting, in its own change.

Every other part of OpenTaberna comes up with `docker compose up -d`. The admin
UI was the exception, running only from source, so bringing the whole system up
meant remembering that one piece worked differently.

Adds Dockerfile, nginx.conf, compose.yaml and .dockerignore mirroring
OpenTaberna/frontend: a multi-stage build serving the built app from nginx on
port 4200.

The API is now addressed as /api rather than a hardcoded http://localhost:8000.
nginx maps it in the container and proxy.conf.json maps it for ng serve, so both
ways of running the app behave identically and neither carries an API host in
the bundle. The Keycloak URL stays absolute, because the browser is redirected
there and a same-origin path would be meaningless.

Closes #13

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YY1ekLLeFLkAU2kvdQ8Ey4
@PhilippTheServer
PhilippTheServer merged commit 066a41c into main Aug 26, 2026
1 check passed
@PhilippTheServer
PhilippTheServer deleted the pl/docker-compose branch August 26, 2026 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No container setup: the admin UI is the only app you cannot 'docker compose up'

1 participant