diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..d0b31a8 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,19 @@ +# Version control +.git +.gitea +.github +.gitignore + +# Documentation +README.md +*.md + +# IDE +.vscode +.idea +*.swp +*.swo + +# OS files +.DS_Store +Thumbs.db diff --git a/Dockerfile b/Dockerfile index 647de35..fbc14e8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,39 +4,33 @@ FROM ghcr.io/linuxserver/baseimage-selkies:ubuntunoble # Environment variables for Selkies ENV \ -# CUSTOM_PORT="8080" \ CUSTOM_HTTPS_PORT="8181" \ TITLE="RuneLite" \ SELKIES_MANUAL_WIDTH="1366" \ SELKIES_MANUAL_HEIGHT="768" \ SELKIES_FRAMERATE="30" \ SELKIES_SCALING_DPI="96" \ -# SELKIES_AUDIO_ENABLED="false" \ SELKIES_GAMEPAD_ENABLED="false" \ SELKIES_UI_SIDEBAR_SHOW_GAMEPADS="false" -# SELKIES_UI_SIDEBAR_SHOW_AUDIO_SETTINGS="false" +# Install Java, tools, and GPU libraries for RuneLite GPU plugin support RUN apt-get update && apt-get install -y --no-install-recommends \ default-jre \ wget \ libnotify-bin \ notification-daemon \ + # GPU/OpenGL libraries for RuneLite GPU plugin + mesa-utils \ + libgl1-mesa-dri \ + libglx-mesa0 \ && rm -rf /var/lib/apt/lists/* -# Add RuneLite icon for Selkies interface and favicon +# Add RuneLite icons and metadata for Selkies interface COPY icons/ /usr/share/selkies/www/ -# Inject iOS webapp meta tags and auth fix into Selkies HTML (if index.html exists) +# Inject iOS webapp meta tags using prepared file (cleaner than multiple sed commands) RUN if [ -f /usr/share/selkies/www/index.html ]; then \ - sed -i '/<\/head>/i\' /usr/share/selkies/www/index.html && \ - sed -i '/<\/head>/i\' /usr/share/selkies/www/index.html && \ - sed -i '/<\/head>/i\' /usr/share/selkies/www/index.html && \ - sed -i '/<\/head>/i\' /usr/share/selkies/www/index.html && \ - sed -i '/<\/head>/i\' /usr/share/selkies/www/index.html && \ - sed -i '/<\/head>/i\' /usr/share/selkies/www/index.html && \ - sed -i '/<\/head>/i\' /usr/share/selkies/www/index.html && \ - sed -i '/<\/head>/i\' /usr/share/selkies/www/index.html && \ - echo "" ; \ + sed -i '/<\/head>/r /usr/share/selkies/www/webapp-meta.html' /usr/share/selkies/www/index.html ; \ fi @@ -48,19 +42,8 @@ RUN wget $RUNELITE_URL -P /usr/local/bin \ && chmod +x /usr/local/bin/runelite # Configure window manager to hide title bars and maximize windows -RUN mkdir -p /etc/xdg/openbox && \ - echo '' > /etc/xdg/openbox/rc.xml && \ - echo '' >> /etc/xdg/openbox/rc.xml && \ - echo ' ' >> /etc/xdg/openbox/rc.xml && \ - echo ' Clearlooks' >> /etc/xdg/openbox/rc.xml && \ - echo ' ' >> /etc/xdg/openbox/rc.xml && \ - echo ' ' >> /etc/xdg/openbox/rc.xml && \ - echo ' ' >> /etc/xdg/openbox/rc.xml && \ - echo ' true' >> /etc/xdg/openbox/rc.xml && \ - echo ' no' >> /etc/xdg/openbox/rc.xml && \ - echo ' ' >> /etc/xdg/openbox/rc.xml && \ - echo ' ' >> /etc/xdg/openbox/rc.xml && \ - echo '' >> /etc/xdg/openbox/rc.xml +RUN mkdir -p /etc/xdg/openbox +COPY openbox-rc.xml /etc/xdg/openbox/rc.xml # Note: PulseAudio configuration handled by Selkies base image @@ -79,6 +62,5 @@ RUN mkdir -p /config/.config/autostart && \ echo 'Name=RuneLite' >> /config/.config/autostart/runelite.desktop && \ chown -R abc:abc /config/.config -# Expose Selkies web interface ports -EXPOSE 8181 -# EXPOSE 8080 8181 \ No newline at end of file +# Expose Selkies web interface port +EXPOSE 8181 \ No newline at end of file diff --git a/README.md b/README.md index 725425c..159a0a0 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,32 @@ docker run -d \ ghcr.io/sethwv/rune-docker:latest ``` +### GPU Acceleration (Recommended for Better Performance) + +RuneLite supports GPU rendering via OpenGL, which is enabled by default in this container. For optimal performance with hardware acceleration: + +**NVIDIA GPUs:** +```bash +docker run -d \ + --name runelite \ + --gpus all \ + -p 8181:8181 \ + -v /path/to/appdata/.runelite:/config/.runelite:rw \ + ghcr.io/sethwv/rune-docker:latest +``` + +**AMD/Intel GPUs:** +```bash +docker run -d \ + --name runelite \ + --device /dev/dri:/dev/dri \ + -p 8181:8181 \ + -v /path/to/appdata/.runelite:/config/.runelite:rw \ + ghcr.io/sethwv/rune-docker:latest +``` + +**Note:** GPU mode provides significantly better FPS and reduced CPU usage. Software rendering (Mesa) is used as fallback if GPU is unavailable. + ## Access Once the container is running, access RuneLite through your web browser: diff --git a/icons/webapp-meta.html b/icons/webapp-meta.html index ed2e47e..eccff70 100644 --- a/icons/webapp-meta.html +++ b/icons/webapp-meta.html @@ -1,3 +1,5 @@ + + diff --git a/openbox-rc.xml b/openbox-rc.xml new file mode 100644 index 0000000..72fc59c --- /dev/null +++ b/openbox-rc.xml @@ -0,0 +1,12 @@ + + + + Clearlooks + + + + true + no + + + diff --git a/runelite b/runelite index 92cebba..2adaedb 100644 --- a/runelite +++ b/runelite @@ -3,5 +3,14 @@ # Ensure we're using the correct home directory export HOME=/config -# Run RuneLite with proper Java options for containerized environment -exec java -jar /usr/local/bin/RuneLite.jar \ No newline at end of file +# Set optimal Java options for RuneLite +# -Xmx: Maximum heap size (adjust based on container memory) +# -Xms: Initial heap size (match Xmx for consistent performance) +# -Dsun.java2d.opengl: Enable OpenGL acceleration for Java2D +# --mode=AUTO: RuneLite will auto-select GPU mode if available +exec java \ + -Xmx1024m \ + -Xms1024m \ + -Dsun.java2d.opengl=true \ + -jar /usr/local/bin/RuneLite.jar \ + --mode=AUTO \ No newline at end of file