diff --git a/Dockerfile b/Dockerfile index 14706ea..a9a63d1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,10 @@ RUN apt update \ && apt install curl lib32gcc-s1 libfreetype6 -y \ && useradd -m -d /home/container -s /bin/bash container +COPY ./scripts /scripts + +RUN chmod +x /scripts/* + RUN mkdir /Logs \ && chown -R container:container /Logs @@ -21,6 +25,7 @@ ENV DEBIAN_FRONTEND=noninteractive WORKDIR /home/container -COPY ./entrypoint.sh /entrypoint.sh -COPY ./scripts /scripts -CMD [ "/bin/bash", "/entrypoint.sh" ] +STOPSIGNAL SIGINT + +ENTRYPOINT ["/scripts/update-resonite.sh"] +CMD ["/scripts/launch-resonite.sh"] diff --git a/entrypoint.sh b/entrypoint.sh deleted file mode 100644 index c8d2993..0000000 --- a/entrypoint.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -sh /scripts/setup-steamcmd.sh -sh /scripts/update-resonite.sh -sh /scripts/launch-resonite.sh diff --git a/scripts/launch-resonite.sh b/scripts/launch-resonite.sh index baedf0c..cf5b6ee 100644 --- a/scripts/launch-resonite.sh +++ b/scripts/launch-resonite.sh @@ -7,7 +7,7 @@ find /Logs -type f -name *.log -atime +${LOG_RETENTION:-30} -delete cd /home/container/Headless/net8.0 if [ "${ENABLE_MODS}" = "true" ]; then - dotnet Resonite.dll -HeadlessConfig /Config/${CONFIG_FILE} -Logs /Logs/ -LoadAssembly Libraries/ResoniteModLoader.dll ${ADDITIONAL_ARGUMENTS} + exec dotnet Resonite.dll -HeadlessConfig /Config/${CONFIG_FILE} -Logs /Logs/ -LoadAssembly Libraries/ResoniteModLoader.dll ${ADDITIONAL_ARGUMENTS} else - dotnet Resonite.dll -HeadlessConfig /Config/${CONFIG_FILE} -Logs /Logs/ ${ADDITIONAL_ARGUMENTS} + exec dotnet Resonite.dll -HeadlessConfig /Config/${CONFIG_FILE} -Logs /Logs/ ${ADDITIONAL_ARGUMENTS} fi diff --git a/scripts/setup-steamcmd.sh b/scripts/setup-steamcmd.sh deleted file mode 100755 index 3de4f8a..0000000 --- a/scripts/setup-steamcmd.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -echo Installing steamcmd -mkdir -p /home/container/steamcmd -curl -sSL -o /tmp/steamcmd.tar.gz https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz -tar -xf /tmp/steamcmd.tar.gz --directory /home/container/steamcmd diff --git a/scripts/update-resonite.sh b/scripts/update-resonite.sh index 4013a63..5011bda 100644 --- a/scripts/update-resonite.sh +++ b/scripts/update-resonite.sh @@ -1,5 +1,12 @@ #!/bin/sh +if [ ! -d "/home/container/steamcmd" ]; then + echo Installing steamcmd + mkdir -p /home/container/steamcmd + curl -sSL -o /tmp/steamcmd.tar.gz https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz + tar -xf /tmp/steamcmd.tar.gz --directory /home/container/steamcmd +fi + HEADLESS_DIRECTORY="/home/container/Headless/net8.0" /home/container/steamcmd/steamcmd.sh +login ${STEAM_USER} ${STEAM_PASS} +force_install_dir /home/container +app_update 2519830 -beta ${STEAM_BRANCH} -betapassword ${BETA_CODE} +quit @@ -23,3 +30,5 @@ if [ "${ENABLE_MODS}" = "true" ]; then curl -SslL https://github.com/resonite-modding-group/ResoniteModLoader/releases/latest/download/ResoniteModLoader.dll -o ${HEADLESS_DIRECTORY}/Libraries/ResoniteModLoader.dll fi + +exec $*