You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: dynamic env vars in docker-compose + GHCR image
docker-compose.yml:
- Image now pulls from ghcr.io/b0bbywan/go-odio-api:latest
- XDG_RUNTIME_DIR and DBUS_SESSION_BUS_ADDRESS read from host env
with fallback to /run/user/${UID:-1000} derivation
- HOME read from host env (PulseAudio cookie path stays consistent)
- All XDG_RUNTIME_DIR-based volume paths use the variable instead
of recalculating from UID
.env.example: documents optional overrides for non-bash shells (fish, etc.)
README: rewrite Docker section with quick-start steps, env var table,
and volume table — no more hardcoded 1000
https://claude.ai/code/session_01GwPe5tCsib8gdiU7UNfH1N
This ensures the Pulseaudio/Pipewire, user D-Bus session and XDG_RUNTIME_DIR are available even without an active login session.
214
214
215
215
### Docker
216
-
You can also run odio as a container!
217
216
218
-
#### Build
219
-
Build the Go binary and Docker image
217
+
A pre-built multi-arch image is available on GHCR (amd64, arm64, arm/v6, arm/v7):
218
+
219
+
```
220
+
ghcr.io/b0bbywan/go-odio-api:latest
221
+
```
222
+
223
+
To build locally instead:
220
224
```bash
221
-
docker build -t odio:latest .
225
+
docker build -t odio-api .
226
+
```
227
+
228
+
#### Quick start
229
+
230
+
```bash
231
+
# 1. Prepare configuration (bind: all required for Docker)
232
+
cp share/config.yaml config.yaml
233
+
# Edit config.yaml: set bind: all
234
+
235
+
# 2. (Optional) Provide your PulseAudio cookie
236
+
cp ~/.config/pulse/cookie ./cookie
237
+
238
+
# 3. (Optional) Only needed if docker compose config shows wrong paths
239
+
cp .env.example .env
240
+
241
+
# 4. Start
242
+
docker compose up -d
222
243
```
223
-
The Dockerfile uses a multi-stage build to compile the Go binary and copy it into a minimal runtime image.
224
-
**Note**: the image includes DBus so that DBus-dependent functionality works correctly inside the container.
225
244
226
-
#### Run
227
-
A docker-compose.yml is provided in the repository for the most common use cases. It runs the container as a non-root user (UID 1000) and mounts the necessary host directories for DBus, systemd, and PulseAudio. You can adapt it for more specific setups if needed
245
+
The `docker-compose.yml` reads `UID`, `XDG_RUNTIME_DIR`, `HOME` and `DBUS_SESSION_BUS_ADDRESS`
246
+
directly from your shell environment — no configuration needed for a standard Linux setup.
247
+
See `.env.example` if your shell doesn't export these automatically (e.g. fish).
228
248
229
-
Environment variables:
230
-
- XDG_RUNTIME_DIR=/run/user/1000 DBus and Pulse runtime directory
231
-
- DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus user DBus session
232
-
- HOME=/home/odio ensures `PulseAudio cookie` is found
The container exposes port 8018 by default and is configured to automatically restart unless stopped. With this configuration, audio and DBus-dependent functionality works seamlessly inside Docker.
257
+
Volumes mounted (all read-only):
244
258
245
-
**Note:** `bind` should be set to `all` in `config.yaml` for remote access with docker. Zeroconf won't work in bridge network mode. It's strongly advised against using host network mode.
259
+
| Volume | Purpose |
260
+
|---|---|
261
+
| `./config.yaml` | odio configuration |
262
+
| `$XDG_RUNTIME_DIR/bus` | user D-Bus session socket |
263
+
| `$XDG_RUNTIME_DIR/systemd` | user systemd folder (utmp unavailable) |
264
+
| `/run/utmp` | user systemd monitoring (utmp available) |
265
+
| `/var/run/dbus/system_bus_socket` | system D-Bus socket |
All mounts are read-only, minimizing the container’s ability to modify the host system.
269
+
**Note:** `bind` must be set to `all` in `config.yaml` for Docker (bridge network). Zeroconf won't work in bridge network mode. Host network mode is strongly discouraged.
0 commit comments