fix: require absolute path for HOST_DATA_DIR in docker-compose example

Relative paths (e.g. ./data) don't work because docker-compose may not
run on the same machine as µPaaS. Remove the default and require the
user to set HOST_DATA_DIR to an absolute host path.
This commit is contained in:
clawbot 2026-02-23 11:42:16 -08:00
parent c9fe4f4bf1
commit 96d23d2cf7

View File

@ -187,9 +187,9 @@ services:
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ${HOST_DATA_DIR:-./data}:/var/lib/upaas
- ${HOST_DATA_DIR}:/var/lib/upaas
environment:
- UPAAS_HOST_DATA_DIR=${HOST_DATA_DIR:-./data}
- UPAAS_HOST_DATA_DIR=${HOST_DATA_DIR}
# Optional: uncomment to enable debug logging
# - DEBUG=true
# Optional: Sentry error reporting
@ -199,8 +199,16 @@ services:
# - METRICS_PASSWORD=secret
```
**Important**: When running µPaaS inside a container, set `UPAAS_HOST_DATA_DIR` to the host path
that maps to `UPAAS_DATA_DIR`. This is required for Docker bind mounts during builds to work correctly.
**Important**: Set `HOST_DATA_DIR` to an **absolute path** on the Docker host before running
`docker compose up`. Relative paths will not work because docker-compose may not run on the same
machine as µPaaS. This value is used both for the bind mount and passed to µPaaS as
`UPAAS_HOST_DATA_DIR` so it can create correct bind mounts during builds.
Example:
```bash
export HOST_DATA_DIR=/srv/upaas-data
docker compose up -d
```
Session secrets are automatically generated on first startup and persisted to `$UPAAS_DATA_DIR/session.key`.