I am running metabase with docker compose and want to run it behind traefik in a subpath, so that it is running as /reporting.
I was able to successfully use Traefik & subpaths for keycloak & nginx for static assets, but there seems to be something causing issues with metabase doing this.
My traefik labels look like the following, and I've tried a variety of options here:
labels:
- "traefik.enable=true"
- "traefik.docker.network=proxy"
- "traefik.http.routers.reporting.priority=100"
- "traefik.http.routers.reporting.rule=PathPrefix(/reporting
)"
- "traefik.http.services.reporting.loadbalancer.server.port=3000"
- "traefik.http.middlewares.reporting.addprefix.prefix=/reporting"
And my docker-compose environment for metabase looks like:
- MB_DB_TYPE=postgres
- MB_DB_HOST=metabase_db
- MB_DB_PORT=5432
- MB_DB_USER=metabase
- MB_DB_PASS=passwordhere
- MB_ENCRYPTION_SECRET_KEY=secrethere
I've tried variations of setting the app url in the metabase settings to / and /reporting, and both fail.
What is happening is I go to /reporting in a browser, and then I get a blank page with metabase header, and it attempting to go to /app/.... instead of /reporting/app/... for assets. This seems to be because the javascript is wiping out the url I give it (see https://github.com/metabase/metabase/blob/master/resources/frontend_client/inline_js/index_bootstrap.js#L23).
And I have attempted to follow what it said (it forced the base url to /, when I set it to reporting) and I tried to set to / and also to /reporting, and both gave me the same result.