Files
MediaManager/Writerside/topics/url-prefix.md
Colin Marc e62f6d4511 docs: clarify usage of frontend_url and BASE_PATH
I initially thought that `frontend_url` would control the prefix. The
docs on `BASE_PATH` weren't enough to get started, either.
2025-11-17 15:11:18 +01:00

31 lines
931 B
Markdown

# URL Prefix
MediaManager, by default, expects to run at the base of a domain, e.g. `maxdorninger.github.io`.
In order to run it on a prefixed path, like `maxdorninger.github.io/media`, the docker image must be built with a special build argument. That's because SvelteKit needs to know the base URL at build time.
In short, clone the repository, then run:
```
docker build \
--build-arg BASE_PATH=/media \
--build-arg VERSION=my-custom-version \
-t MediaManager:my-custom-version \
-f Dockerfile .
```
You also need to set the `BASE_PATH` environment variable at runtime in `docker-compose.yaml`:
```yaml
services:
mediamanager:
image: MediaManager:my-custom-version
ports:
- "8000:8000"
environment:
BASE_PATH: /media
...
```
Finally, ensure that whatever reverse proxy you're using leaves the incoming path unchanged; that is, you should not strip the `/media` from `/media/web/`.