diff --git a/.env.example b/.env.example index e21e65c..1ec0651 100644 --- a/.env.example +++ b/.env.example @@ -4,3 +4,10 @@ ABOGEN_SETTINGS_DIR=./config ABOGEN_TEMP_DIR=./storage/tmp ABOGEN_OUTPUT_DIR=./storage/output + +# UID/GID used when running the Docker container. 1000:1000 matches most Linux hosts. +# Find your current values with: +# id -u # UID +# id -g # GID +ABOGEN_UID=1000 +ABOGEN_GID=1000 diff --git a/README.md b/README.md index d288fab..aeec516 100644 --- a/README.md +++ b/README.md @@ -50,12 +50,23 @@ Browse to http://localhost:8808. Uploaded source files are stored in `/data/uplo | `ABOGEN_DEBUG` | `false` | Enable Flask debug mode | | `ABOGEN_UPLOAD_ROOT` | `/data/uploads` | Directory where uploaded files are stored | | `ABOGEN_OUTPUT_ROOT` | `/data/outputs` | Directory for generated audio and subtitles | +| `ABOGEN_UID` | `1000` | UID that the container should run as (matches host user) | +| `ABOGEN_GID` | `1000` | GID that the container should run as (matches host group) | | `ABOGEN_TEMP_DIR` | Platform cache dir (e.g. `~/.cache/abogen`) | Override the cache/temp directory | | `ABOGEN_OUTPUT_DIR` | Same as `ABOGEN_OUTPUT_ROOT` | Override the rendered output directory | | `ABOGEN_SETTINGS_DIR` | Platform config dir (e.g. `~/.config/abogen`) | Override where JSON settings (profiles, config) are stored | Set any of these with `-e VAR=value` when starting the container. +To discover your local UID/GID for matching file permissions inside the container, run: + +```bash +id -u +id -g +``` + +Use those values to populate `ABOGEN_UID` / `ABOGEN_GID` in your `.env` file. + ### Docker Compose (GPU by default) The repo includes `docker-compose.yaml`, which targets GPU hosts out of the box. Install the NVIDIA Container Toolkit and run: diff --git a/docker-compose.yaml b/docker-compose.yaml index e856208..3564a48 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -7,6 +7,7 @@ services: TORCH_INDEX_URL: ${TORCH_INDEX_URL:-https://download.pytorch.org/whl/cu124} TORCH_VERSION: ${TORCH_VERSION:-} image: abogen:latest + user: "${ABOGEN_UID:-1000}:${ABOGEN_GID:-1000}" ports: - "${ABOGEN_PORT:-8808}:8808" volumes: