Skip to content

Commit 8c516f7

Browse files
committed
feat(docker): upgrade to Java 21, add healthchecks, host network, BuildKit cache
1 parent 2641946 commit 8c516f7

4 files changed

Lines changed: 36 additions & 54 deletions

File tree

.env.example

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# SlimeVR Docker - Configuration Examples
2+
# Copy to .env and customize if needed
3+
4+
# WEBGUI_PORT=8080
5+
# SLIMEVR_VERSION=latest

docker-compose.linux.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

docker-compose.yml

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,40 @@ services:
88
restart: unless-stopped
99
environment:
1010
- LIBGL_ALWAYS_INDIRECT=0
11-
ports:
12-
- "6969:6969/udp" # Tracker data (SlimeVR default UDP port)
13-
- "21110:21110" # WebSocket VR Bridge for integrations
14-
- "8266:8266" # OTA firmware update
15-
- "9000:9000" # OSC output (shared by VRC and router)
16-
- "9001:9001" # VRC OSC input (VRChat tracking)
17-
- "9002:9002" # OSC Router input (for rerouting OSC)
18-
- "39539:39539" # VMC output (used by VSeeFace, etc.)
19-
- "39540:39540" # VMC input
20-
- "4768:4768/udp" # Tracker discovery / legacy LAN detection
11+
network_mode: host
12+
privileged: true
13+
devices:
14+
- /dev/dri:/dev/dri
15+
group_add:
16+
- dialout
17+
- video
2118
volumes:
2219
- slimevr-config:/root/.config/dev.slimevr.SlimeVR
2320
- slimevr-gui:/gui_mount
21+
- /dev:/dev
22+
- /run/udev:/run/udev:ro
23+
healthcheck:
24+
test: ["CMD", "curl", "-f", "http://localhost:6969"]
25+
interval: 30s
26+
timeout: 10s
27+
retries: 3
28+
start_period: 10s
2429

2530
nginx:
2631
build: ./nginx
2732
container_name: slimevr_gui
2833
restart: unless-stopped
2934
environment:
3035
WEBGUI_PORT: ${WEBGUI_PORT:-8080}
31-
ports:
32-
- "${WEBGUI_PORT:-8080}:${WEBGUI_PORT:-8080}"
36+
network_mode: host
3337
volumes:
3438
- slimevr-gui:/usr/share/nginx/html:ro
39+
healthcheck:
40+
test: ["CMD", "wget", "-q", "--spider", "http://localhost:${WEBGUI_PORT:-8080}/"]
41+
interval: 30s
42+
timeout: 5s
43+
retries: 3
44+
start_period: 5s
3545

3646
volumes:
3747
slimevr-config:

slimevr/Dockerfile

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1-
FROM eclipse-temurin:17-jdk
1+
# syntax=docker/dockerfile:1.4
2+
FROM eclipse-temurin:21-jre
23

34
ARG SLIMEVR_VERSION=latest
45
ENV SLIMEVR_VERSION=${SLIMEVR_VERSION}
56

67
WORKDIR /app
78

8-
RUN apt-get update && \
9+
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
10+
--mount=type=cache,target=/var/lib/apt,sharing=locked \
11+
apt-get update && \
912
apt-get install -y --no-install-recommends curl libusb-1.0-0 udev && \
10-
if [ "${SLIMEVR_VERSION}" = "latest" ] || [ -z "${SLIMEVR_VERSION}" ]; then \
13+
apt-get clean
14+
15+
RUN if [ "${SLIMEVR_VERSION}" = "latest" ] || [ -z "${SLIMEVR_VERSION}" ]; then \
1116
echo "Fetching latest SlimeVR version..." && \
1217
SLIMEVR_VERSION=$(curl -sL https://api.github.com/repos/SlimeVR/SlimeVR-Server/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | sed 's/^v//') && \
1318
echo "Latest version: ${SLIMEVR_VERSION}"; \
@@ -16,9 +21,7 @@ RUN apt-get update && \
1621
curl -L -o slimevr-gui-dist.tar.gz https://github.com/SlimeVR/SlimeVR-Server/releases/download/v${SLIMEVR_VERSION}/slimevr-gui-dist.tar.gz && \
1722
mkdir /gui && \
1823
tar -xzf slimevr-gui-dist.tar.gz -C /gui && \
19-
rm slimevr-gui-dist.tar.gz && \
20-
apt-get clean && \
21-
rm -rf /var/lib/apt/lists/*
24+
rm slimevr-gui-dist.tar.gz
2225

2326
VOLUME ["/gui_mount"]
2427

0 commit comments

Comments
 (0)