Skip to content

Commit 2641946

Browse files
committed
feat(docker): auto-fetch latest SlimeVR version, make .env optional
1 parent 1479c71 commit 2641946

4 files changed

Lines changed: 12 additions & 9 deletions

File tree

.env

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

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.env

docker-compose.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ services:
33
build:
44
context: ./slimevr
55
args:
6-
SLIMEVR_VERSION: ${SLIMEVR_VERSION}
6+
SLIMEVR_VERSION: ${SLIMEVR_VERSION:-latest}
77
container_name: slimevr
88
restart: unless-stopped
99
environment:
@@ -27,12 +27,12 @@ services:
2727
container_name: slimevr_gui
2828
restart: unless-stopped
2929
environment:
30-
WEBGUI_PORT: ${WEBGUI_PORT}
30+
WEBGUI_PORT: ${WEBGUI_PORT:-8080}
3131
ports:
32-
- "${WEBGUI_PORT}:${WEBGUI_PORT}"
32+
- "${WEBGUI_PORT:-8080}:${WEBGUI_PORT:-8080}"
3333
volumes:
3434
- slimevr-gui:/usr/share/nginx/html:ro
3535

3636
volumes:
3737
slimevr-config:
38-
slimevr-gui:
38+
slimevr-gui:

slimevr/Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
FROM eclipse-temurin:17-jdk
22

3-
ARG SLIMEVR_VERSION
3+
ARG SLIMEVR_VERSION=latest
44
ENV SLIMEVR_VERSION=${SLIMEVR_VERSION}
55

66
WORKDIR /app
77

88
RUN apt-get update && \
99
apt-get install -y --no-install-recommends curl libusb-1.0-0 udev && \
10+
if [ "${SLIMEVR_VERSION}" = "latest" ] || [ -z "${SLIMEVR_VERSION}" ]; then \
11+
echo "Fetching latest SlimeVR version..." && \
12+
SLIMEVR_VERSION=$(curl -sL https://api.github.com/repos/SlimeVR/SlimeVR-Server/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | sed 's/^v//') && \
13+
echo "Latest version: ${SLIMEVR_VERSION}"; \
14+
fi && \
1015
curl -L -o slimevr.jar https://github.com/SlimeVR/SlimeVR-Server/releases/download/v${SLIMEVR_VERSION}/slimevr.jar && \
1116
curl -L -o slimevr-gui-dist.tar.gz https://github.com/SlimeVR/SlimeVR-Server/releases/download/v${SLIMEVR_VERSION}/slimevr-gui-dist.tar.gz && \
1217
mkdir /gui && \
@@ -17,4 +22,4 @@ RUN apt-get update && \
1722

1823
VOLUME ["/gui_mount"]
1924

20-
CMD cp -r /gui/* /gui_mount && java -XX:ActiveProcessorCount=$(nproc) -jar slimevr.jar run --no-gui
25+
CMD cp -r /gui/* /gui_mount && java -XX:ActiveProcessorCount=$(nproc) -jar slimevr.jar run --no-gui

0 commit comments

Comments
 (0)