forked from games-on-whales/gow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
162 lines (156 loc) · 5.71 KB
/
docker-compose.yml
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
version: "3"
services:
xorg:
restart: always
build:
context: ./images/
dockerfile: xorg/Dockerfile
image: gameonwhales/xorg
container_name: Armax_xorg
network_mode: ${UDEVD_NETWORK}
privileged: true
volumes:
# Shared with Sunshine in order to get mouse and joypad working
- /dev/input:/dev/input:ro
- udev:/run/udev/:ro
# The xorg socket, it'll be populated when up and running
- ${XORG_SOCKET}:/tmp/.X11-unix
ipc: ${XORG_IPC} # Needed for MIT-SHM, removing this should cause a performance hit see https://github.com/jessfraz/dockerfiles/issues/359
environment:
DISPLAY: ${XORG_DISPLAY}
RESOLUTION: ${XORG_RESOLUTION}
CURRENT_OUTPUT: ${XORG_DISPLAY_PORT}
REFRESH_RATE: ${XORG_REFRESH_RATE}
FORCE_RESOLUTION: ${XORG_FORCE_RESOLUTION}
pulse:
restart: always
build:
context: ./images/
dockerfile: pulseaudio/Dockerfile
image: gameonwhales/pulseaudio
container_name: Armax_pulse
ipc: ${XORG_IPC}
volumes:
- ${PULSE_SOCKET_HOST}:${PULSE_SOCKET_GUEST}
####################
# This is not really needed right now
# It still relies on host udev
# I'll keep it so that we can isolate services that needs udev
# And it's good to log the events to debug Sunshine created devices
udevd:
restart: always
build:
context: ./images/
dockerfile: udevd/Dockerfile
image: gameonwhales/udevd
container_name: Armax_udevd
# Setting network to host
# There must be a way to avoid this but I can't figure it out
# We need to be on the host network in order to get the PF_NETLINK socket
# You can listen to events even without that socket but Xorg and RetroArch will not pickup the devices
network_mode: host
privileged: true
volumes:
- udev:/run/udev/
####################
sunshine:
restart: always
depends_on:
- xorg
- pulse
build:
context: ./images/
dockerfile: sunshine/Dockerfile
# Uncomment the following to override the default sunshine version
# args:
# BUILD_TYPE: RELEASE # To debug run a console inside then gdb -args sunshine > r > on exception: bt
# SUNSHINE_SHA: d9f79527104694a223eb9d64309e9337f46909d6
image: gameonwhales/sunshine
container_name: Armax_sunshine
ports:
- 47984-47990:47984-47990/tcp
- 48010:48010
- 47998-48000:47998-48000/udp
runtime: ${DOCKER_RUNTIME}
privileged: true
volumes:
# Xorg socket in order to get the screen
- ${XORG_SOCKET}:/tmp/.X11-unix
# Pulse socket, audio
- ${PULSE_SOCKET_HOST}:${PULSE_SOCKET_GUEST}
# Home directory: sunshine state + configs
- ${local_state}/:/home/retro/
# OPTIONAL: host dbus used by avahi in order to publish Sunshine for auto network discovery
- ${DBUS}:/run/dbus:ro
ipc: ${SHARED_IPC} # Needed for MIT-SHM, removing this should cause a performance hit see https://github.com/jessfraz/dockerfiles/issues/359
environment:
DISPLAY: ${XORG_DISPLAY}
NVIDIA_DRIVER_CAPABILITIES: utility,video,graphics,display
NVIDIA_VISIBLE_DEVICES: ${GPU_UUID}
LOG_LEVEL: ${SUNSHINE_LOG_LEVEL}
GOW_REQUIRED_DEVICES: /dev/uinput /dev/input/event* /dev/dri/*
# Username and password for the web-ui at https://xxx.xxx.xxx.xxx:47990
SUNSHINE_USER: ${SUNSHINE_USER}
SUNSHINE_PASS: ${SUNSHINE_PASS}
# Intel drivers, see https://wiki.debian.org/HardwareVideoAcceleration#Installation
# LIBVA_DRIVERS_PATH: /usr/lib/x86_64-linux-gnu/dri/
# LIBVA_DRIVER_NAME: i965 # or i965 for older generations
XDG_RUNTIME_DIR: /tmp/.X11-unix
PULSE_SERVER: ${PULSE_SERVER}
TZ: $TZ
retroarch:
restart: always
depends_on:
- xorg
- pulse
- sunshine
runtime: ${DOCKER_RUNTIME}
container_name: Armax_retroarch
build:
context: ./images/
dockerfile: retroarch/Dockerfile
image: gameonwhales/retroarch
# network_mode: host
privileged: true
network_mode: ${UDEVD_NETWORK}
volumes:
# Followings are needed in order to get joystick support
- /dev/input:/dev/input:ro
- udev:/run/udev/:ro
# Xorg socket in order to get the screen
- ${XORG_SOCKET}:/tmp/.X11-unix
# Pulse socket, audio
- ${PULSE_SOCKET_HOST}:${PULSE_SOCKET_GUEST}
# Home directory: retroarch games, downloads, cores etc
- ${local_state}/:/home/retro/
- RetroRoms:/home/retro/roms:rw
# some emulators need more than 64 MB of shared memory - see https://github.com/libretro/dolphin/issues/222
# TODO: why shm_size doesn't work ??????
- type: tmpfs
target: /dev/shm
tmpfs:
size: ${SHM_SIZE}
ipc: ${SHARED_IPC} # Needed for MIT-SHM, removing this should cause a performance hit see https://github.com/jessfraz/dockerfiles/issues/359
environment:
DISPLAY: ${XORG_DISPLAY}
NVIDIA_DRIVER_CAPABILITIES: utility,video,graphics,display
NVIDIA_VISIBLE_DEVICES: ${GPU_UUID}
# Which devices does GoW need to be able to use? The docker user will be
# added to the groups that own these devices, to help with permissions
# issues
# These values are the defaults, but you can add others if needed
GOW_REQUIRED_DEVICES: /dev/uinput /dev/input/event* /dev/dri/* /dev/snd/*
PULSE_SERVER: ${PULSE_SERVER}
TZ: $TZ
####################
volumes:
xorg: # This will hold the xorg socket file and it'll be shared between containers
pulse: # This will hold the xorg socket
udev: # This will hold shared udev files
RetroRoms:
name: RetroRoms
driver: local
driver_opts:
type: nfs
o: vers=3,addr=ds920,rw
device: ":/volume1/RetroPieRoms"