feat: Add UID/GID configuration to .env.example and update README for container user settings

This commit is contained in:
JB
2025-10-06 14:30:55 -07:00
parent 7d132e6fcc
commit 26e0e764db
3 changed files with 19 additions and 0 deletions
+7
View File
@@ -4,3 +4,10 @@
ABOGEN_SETTINGS_DIR=./config ABOGEN_SETTINGS_DIR=./config
ABOGEN_TEMP_DIR=./storage/tmp ABOGEN_TEMP_DIR=./storage/tmp
ABOGEN_OUTPUT_DIR=./storage/output 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
+11
View File
@@ -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_DEBUG` | `false` | Enable Flask debug mode |
| `ABOGEN_UPLOAD_ROOT` | `/data/uploads` | Directory where uploaded files are stored | | `ABOGEN_UPLOAD_ROOT` | `/data/uploads` | Directory where uploaded files are stored |
| `ABOGEN_OUTPUT_ROOT` | `/data/outputs` | Directory for generated audio and subtitles | | `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_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_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 | | `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. 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) ### 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: The repo includes `docker-compose.yaml`, which targets GPU hosts out of the box. Install the NVIDIA Container Toolkit and run:
+1
View File
@@ -7,6 +7,7 @@ services:
TORCH_INDEX_URL: ${TORCH_INDEX_URL:-https://download.pytorch.org/whl/cu124} TORCH_INDEX_URL: ${TORCH_INDEX_URL:-https://download.pytorch.org/whl/cu124}
TORCH_VERSION: ${TORCH_VERSION:-} TORCH_VERSION: ${TORCH_VERSION:-}
image: abogen:latest image: abogen:latest
user: "${ABOGEN_UID:-1000}:${ABOGEN_GID:-1000}"
ports: ports:
- "${ABOGEN_PORT:-8808}:8808" - "${ABOGEN_PORT:-8808}:8808"
volumes: volumes: