diff --git a/.scripts/entrypoint.sh b/.scripts/entrypoint.sh new file mode 100644 index 0000000..89eb72f --- /dev/null +++ b/.scripts/entrypoint.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +#Start pulseaudio +/usr/bin/pulseaudio --system --verbose --log-target=stderr --realtime=true --disallow-exit -F /etc/pulse/default.pa \ No newline at end of file diff --git a/.scripts/gpu b/.scripts/gpu deleted file mode 100644 index 2ae6958..0000000 --- a/.scripts/gpu +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash -# Version 0.0.1 - -#TODO: install nvidia vulkan drivers, or AMD/Intel Mesa drivers -#TODO: install dependencies for gpu-installer - -# https://aur.archlinux.org/packages/gpu-screen-recorder-git -# https://github.com/lutris/docs/blob/master/InstallingDrivers.md#amd--intel -# https://github.com/lutris/docs/blob/master/InstallingDrivers.md#nvidia - -# https://discourse.ubuntu.com/t/enabling-gpu-acceleration-on-ubuntu-on-wsl2-with-the-nvidia-cuda-platform/26604 - -xarg="$1" - -xnstll() { - if [[ $EUID -ne 0 ]]; then - echo "This script must be run as root or via sudo!" - exit 1 - else - add-apt-repository ppa:graphics-drivers/ppa - dpkg --add-architecture i386 - apt update -y - apt upgrade -y - apt install -y nvidia-driver-535 libvulkan1 libvulkan1:i386 - rm -rf /var/lib/apt/lists/* - fi -} - -usage() { - echo -e "\n$(basename $0): ERROR - $*" 1>&2 - echo -e "\nusage: $(basename $0)\n [-c,--configure] \n \n (configure) install dependencies and configure your GPU \n \n" 1>&2 -} - -if [[ $# -lt 1 ]]; then - usage "one option required!" -else - case $xarg in - -c | --configure) - # install wine - xnstll - ;; - -* | \* | *) - # do_usage - usage "invalid option $1" - exit 1 - ;; - esac -fi diff --git a/server.Dockerfile b/server.Dockerfile index 0600eb6..dc1aef8 100644 --- a/server.Dockerfile +++ b/server.Dockerfile @@ -40,6 +40,7 @@ ENV XDG_RUNTIME_DIR=/run/user/1000/ \ WAYLAND_DISPLAY=wayland-0 \ PUID=0 \ PGID=0 \ + HOME="/root" \ UNAME="root" RUN apt-get update -y \ @@ -103,10 +104,19 @@ RUN apt-get update -y \ gamescope \ && rm -rf /var/lib/apt/lists/* -COPY .scripts/ /usr/bin/netris/ +#Install pulseaudio +RUN apt-get update -y \ + && apt-get install -y --no-install-recommends \ + alsa-utils \ + libasound2 \ + libasound2-plugins \ + pulseaudio \ + && rm -rf /var/lib/apt/lists/* \ + && echo "load-module module-native-protocol-tcp auth-anonymous=1" >> /etc/pulse/default.pa +COPY .scripts/ /usr/bin/netris/ RUN ls -la /usr/bin/netris \ - && chmod +x /usr/bin/netris/proton + && chmod +x /usr/bin/netris/proton /usr/bin/netris/entrypoint.sh #Install proton RUN /usr/bin/netris/proton -i @@ -116,4 +126,4 @@ ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini RUN chmod +x /tini ENTRYPOINT ["/tini", "--"] -CMD [ "/bin/bash" ] \ No newline at end of file +CMD [ "/usr/bin/netris/entrypoint.sh" ] \ No newline at end of file