-
-
Notifications
You must be signed in to change notification settings - Fork 97
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
69 lines (68 loc) · 2.41 KB
/
docker-compose.yml
File metadata and controls
69 lines (68 loc) · 2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Docker Compose for AI Runner
#
# Usage:
# GUI mode: docker compose run --rm airunner
# Headless mode: docker compose run --rm --service-ports airunner --headless
#
# X11 Setup (required for GUI mode):
# The container now runs as your user (via UID/GID), so X11 access works automatically.
# If you get X11 permission errors, run: xhost +SI:localuser:$USER
#
# Note: --service-ports is required for headless mode to expose port 8080
#
# This file uses relative paths so airunner can be located anywhere.
services:
# Main AI Runner service - supports both GUI and headless modes
airunner:
build:
context: .
dockerfile: Dockerfile
# Run as host user to avoid file permission issues
user: "${UID:-1000}:${GID:-1000}"
volumes:
# Mount local airunner data folder (models, database, etc.)
- ~/.local/share/airunner:/home/airunner/.local/share/airunner
# Mount local huggingface cache
- ~/.cache/huggingface:/home/airunner/.cache/huggingface
# Mount source code for live development
- ./src:/app/src:ro
# X11 socket for GUI display
- /tmp/.X11-unix:/tmp/.X11-unix:rw
# X11 authorization (use XAUTHORITY env var or common locations)
- ${XAUTHORITY:-/run/user/1000/gdm/Xauthority}:/home/airunner/.Xauthority:ro
# PulseAudio for audio
- ${XDG_RUNTIME_DIR:-/run/user/1000}/pulse/native:/tmp/pulse/native:rw
- ~/.config/pulse/cookie:/tmp/pulse/cookie:ro
ports:
- "8080:8080"
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [ gpu ]
environment:
- PYTHONUNBUFFERED=1
- HOME=/home/airunner
- HF_HOME=/home/airunner/.cache/huggingface
- AIRUNNER_DATA_DIR=/home/airunner/.local/share/airunner
# X11 display (for GUI mode)
- DISPLAY=${DISPLAY}
- XAUTHORITY=/home/airunner/.Xauthority
- QT_X11_NO_MITSHM=1
# QtWebEngine sandbox fix
- QTWEBENGINE_DISABLE_SANDBOX=1
- QTWEBENGINE_CHROMIUM_FLAGS=--no-sandbox
# PulseAudio (for GUI mode with audio)
- PULSE_SERVER=unix:/tmp/pulse/native
- PULSE_COOKIE=/tmp/pulse/cookie
# NVIDIA
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=all
# Interactive mode for GUI
stdin_open: true
tty: true
# Prevent 'docker compose up' from starting this service
profiles:
- manual