diff --git a/Dockerfile b/Dockerfile index ab197bb..a10fe1f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,28 +1,10 @@ -FROM xenon3d/archean-server-alpha +FROM ghcr.io/pelican-eggs/yolks:debian -RUN rm -f /home/container -RUN adduser --disabled-password --home /home/container container +USER root -WORKDIR /home/container - -RUN ln -s /Archean-data/ /home/container/data -RUN ln -s /Archean-server-alpha/ /home/container/bin - -COPY archean_start.sh archean_start.sh -COPY server.ini data/server/server.ini -COPY entrypoint.sh /entrypoint.sh - -RUN chown -R container:container /home/container/ -RUN chown -R container:container /Archean-data/ -RUN chown -R container:container /Archean-server-alpha/ -RUN chmod -R 755 /home/container -RUN chmod -R 755 /Archean-data -RUN chmod -R 755 /Archean-server-alpha +RUN apt install openssl libpng16-16 libharfbuzz-bin USER container -ENV USER=container HOME=/home/container - -CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/archean_start.sh b/archean_start.sh index 74e701a..1bb3b7a 100755 --- a/archean_start.sh +++ b/archean_start.sh @@ -1,7 +1,14 @@ #!/bin/bash -sed "s/^game_mode=.*/game_mode=$( [ "$GAME_MODE" = "creative" ] && echo 0 || echo 1)/" data/server/server.ini > data/server/server.ini -sed "s/^server_online=.*/server_online=$( [ "$ONLINE_MODE" = "0" ] && echo no || echo yes)/" data/server/server.ini > data/server/server.ini +DIRECTORY="Archean-data" + +if [ ! -d "$DIRECTORY" ]; then + curl -o "$DIRECTORY/server/server.ini" https://git.tomatentum.net/tueem/archean-server-pelican/raw/branch/master/server.ini +fi + + +sed "s/^game_mode=.*/game_mode=$( [ "$GAME_MODE" = "creative" ] && echo 0 || echo 1)/" Archean-data/server/server.ini > Archean-data/server/server.ini +sed "s/^server_online=.*/server_online=$( [ "$ONLINE_MODE" = "0" ] && echo no || echo yes)/" Archean-data/server/server.ini > Archean-data/server/server.ini sed "s/^max_simultaneous_players=.*/max_simultaneous_players=$MAX_PLAYERS/" data/server/server.ini > data/server/server.ini sed "s/^password=.*/password=$PASSWORD/" data/server/server.ini > data/server/server.ini sed "s/^server_public_name=.*/server_public_name=$NAME/" data/server/server.ini > data/server/server.ini diff --git a/entrypoint.sh b/entrypoint.sh deleted file mode 100644 index 4adb8f2..0000000 --- a/entrypoint.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -cd /home/container - -./archean_start.sh - -# Replace Startup Variables -MODIFIED_STARTUP=`eval echo $(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')` -echo ":/home/container$ ${MODIFIED_STARTUP}" - -# Run the Server -${MODIFIED_STARTUP} \ No newline at end of file