Adds dockerfiles for the skyrim server

This commit is contained in:
zontreck 2024-07-10 15:41:48 -07:00
commit ad7c3dac0d
5 changed files with 89 additions and 0 deletions

12
build.sh Normal file
View file

@ -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

11
installer/Dockerfile Normal file
View file

@ -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

20
installer/install.sh Normal file
View file

@ -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."

33
latest/Dockerfile Normal file
View file

@ -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"]

13
latest/entrypoint.sh Normal file
View file

@ -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}