diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6e88169 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM xenon3d/archean-server-alpha + +RUN adduser --disabled-password --home /home/container container + +USER container +ENV USER=container HOME=/home/container + +WORKDIR /home/container +CMD ["/bin/bash", "/entrypoint.sh"] + +COPY archean_start.sh archean_start.sh +COPY server.ini server/server.ini +COPY entrypoint.sh /entrypoint.sh + +USER root + +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 diff --git a/README.md b/README.md index 7ea9d24..94a80cf 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,6 @@ # archean-server-pelican +This is a modified docker container of the server container for archean to work with pelican panel. + +- [Docker repo](https://hub.docker.com/repository/docker/tueem/archean-server-pelican/general) + diff --git a/archean_start.sh b/archean_start.sh new file mode 100755 index 0000000..44d46ad --- /dev/null +++ b/archean_start.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +sed "s/^game_mode=.*/game_mode=$( [ "$GAME_MODE" = "creative" ] && echo 0 || echo 1)/" server/server.ini > server/server.ini +sed "s/^server_online=.*/server_online=$( [ "$ONLINE_MODE" = "0" ] && echo no || echo yes)/" server/server.ini > server/server.ini +sed "s/^max_simultaneous_players=.*/max_simultaneous_players=$MAX_PLAYERS/" server/server.ini > server/server.ini +sed "s/^password=.*/password=$PASSWORD/" server/server.ini > server/server.ini +sed "s/^server_public_name=.*/server_public_name=$NAME/" server/server.ini > server/server.ini +sed "s/^listen_port=.*/listen_port=$SERVER_PORT/" server/server.ini > server/server.ini +sed "s/^spawn=.*/spawn=$SPAWN_PLANET/" server/server.ini > server/server.ini +sed "s/^auto_save_interval_seconds=.*/auto_save_interval_seconds=$AUTOSAVE_INTERVAL/" server/server.ini > server/server.ini +sed "s/^updates_per_second=.*/updates_per_second=$UPDATES_PER_SECOND/" server/server.ini > server/server.ini +sed "s/^physics_steps_per_update=.*/physics_steps_per_update=$PHYSICS_UPDATES_PER_UPDATE/" server/server.ini > server/server.ini \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..4adb8f2 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,11 @@ +#!/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 diff --git a/server.ini b/server.ini new file mode 100644 index 0000000..d8ec76c --- /dev/null +++ b/server.ini @@ -0,0 +1,18 @@ +[server] +server_public_name=Pelican Server +game_mode=0 +server_online=no +accept_remote_connections=yes +max_simultaneous_players=16 +password= + +[networking] +listen_port=8881 +listen_new_connection_timeout_ms=500 +automatic_blacklist=no + +[game] +spawn=earth +updates_per_second=25 +physics_steps_per_update=8 +auto_save_interval_seconds=30