commit ad7c3dac0d76a479a43069bde9620619f5cc40e2 Author: zontreck Date: Wed Jul 10 15:41:48 2024 -0700 Adds dockerfiles for the skyrim server diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..d6adac5 --- /dev/null +++ b/build.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +docker build -t git.zontreck.com/zontreck/skyrim:latest latest +docker push git.zontreck.com/zontreck/skyrim:latest + +docker build -t git.zontreck.com/zontreck/skyrim:installer installer +docker push git.zontreck.com/zontreck/skyrim:installer + +docker rmi git.zontreck.com/zontreck/skyrim:latest +docker rmi git.zontreck.com/zontreck/skyrim:installer + +docker system prune --volumes -f \ No newline at end of file diff --git a/installer/Dockerfile b/installer/Dockerfile new file mode 100644 index 0000000..89763d5 --- /dev/null +++ b/installer/Dockerfile @@ -0,0 +1,11 @@ +FROM tiltedphoques/st-reborn-server:latest as base + +FROM alpine:latest as final + +# Note: The install script run on the container will copy the files out of this image and onto the persistent mounted storage on the Pterodactyl server. + +# Copy libstdc++6 to final image +COPY --from=base /lib/x86_64-linux-gnu/libstdc++.so.6 /home/server/libstdc++.so.6 + +# Copy server binaries to final image +COPY --from=base /home/server/ /home/server \ No newline at end of file diff --git a/installer/install.sh b/installer/install.sh new file mode 100644 index 0000000..1d28150 --- /dev/null +++ b/installer/install.sh @@ -0,0 +1,20 @@ +#!/bin/ash + +# SkyrimTogether Egg Installation Script +# Author: Hayden Andreyka (haydenandreyka@gmail.com) + +# Description: Uses custom installer image that contains SkyrimTogether binaries and copies binaries to mounted persistent folder on Pterodactyl. +# This setup is not ideal but due to the "creative" build process of the ST server, it's the most reliable solution possible. + +# Delete existing binaries +if [ -d "/mnt/server/bin" ] +then + rm -rf /mnt/server/bin/* +else + mkdir -p /mnt/server/bin +fi +# Copy binaries from their home on installer image to the persistent mount point +cp /home/server/* /mnt/server/bin + +# Done! +echo "Done installing. Re-run the installer to update the server." \ No newline at end of file diff --git a/latest/Dockerfile b/latest/Dockerfile new file mode 100644 index 0000000..911d57e --- /dev/null +++ b/latest/Dockerfile @@ -0,0 +1,33 @@ +FROM debian:latest + +LABEL author="Tara Piccari" +LABEL maintainer="tarapiccari@gmail.com" +LABEL repository="https://git.zontreck.com/zontreck/SkyrimTogether" + +SHELL ["/bin/bash", "-c"] + +ENV DEBIAN_FRONTEND noninteractive + +RUN useradd -m -d /home/container -s /bin/bash container +ENV USER=container +ENV HOME=/home/container + +# Update the base image +RUN apt-get update +RUN apt-get upgrade -y + +# Install dependencies +RUN apt-get install -y build-essential gdb git wget curl tar zip unzip binutils xz-utils cabextract iproute2 net-tools netcat telnet software-properties-common apt-transport-https + +RUN apt-get install -y libfontconfig icu-devtools sqlite3 libsqlite3-dev locales ffmpeg gnupg2 ca-certificates + +RUN apt-get install -y libz-dev rapidjson-dev tzdata libstdc++6 + +# Configure Locale +RUN update-locale lang=en_US.UTF-8 +RUN dpkg-reconfigure --frontend noninteractive locales + +WORKDIR /home/container + +COPY ./entrypoint.sh /entrypoint.sh +CMD ["/entrypoint.sh"] \ No newline at end of file diff --git a/latest/entrypoint.sh b/latest/entrypoint.sh new file mode 100644 index 0000000..e90e9db --- /dev/null +++ b/latest/entrypoint.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +cd /home/container + +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') +export INTERNAL_IP + +# Replace startup vars +MODIFIED_STARTUP=$(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g') + +echo -e ":/home/container$ ${MODIFIED_STARTUP} + +eval ${MODIFIED_STARTUP} \ No newline at end of file