COLLECT_API_ENDPOINT does not work
I just upgraded umami to v1.34.0 and set the environment variable COLLECT_API_ENDPOINT: '/api/x' in docker-compose settings.
services:
umami:
image: ghcr.io/umami-software/umami:postgresql-latest
environment:
TRACKER_SCRIPT_NAME: 'script'
COLLECT_API_ENDPOINT: '/api/x'
But this environment variable seems does not work. In my tracker script, the endpoint is still /api/collect. I tried to clear cookies and restarted the docker container, but nothing changed.
I have the same problem
Just updated the documentation to make this more clear, but COLLECT_API_ENDPOINT is a build time variable. So you will need to rebuild the application for it to take effect. See https://umami.is/docs/environment-variables
Should be fixed in v1.35.0.
Just updated the documentation to make this more clear, but
COLLECT_API_ENDPOINTis a build time variable. So you will need to rebuild the application for it to take effect. See https://umami.is/docs/environment-variables
@mikecao For the runtime variables such as TRACKER_SCRIPT_NAME, I can set it in a docker-compose file.
But how about a build time variable in v1.35.0? Does it mean that I need to build a custom Docker image first?
https://docker-docs.netlify.app/compose/compose-file/#args
Hey @leirock, how have you solved this?
I've tried creating my own Dockerfile like this (./umami/Dockerfile):
ARG COLLECT_API_ENDPOINT
FROM ghcr.io/mikecao/umami:postgresql-latest
And I pass the build argument like this in my docker-compose.yml:
umami:
build:
context: ./umami
args:
COLLECT_API_ENDPOINT: "/api/abc"
I feel like I'm missing something obvious 😅
@ioiste Sorry, I'm just using the official docker image, so I haven't tried the variable COLLECT_API_ENDPOINT.