From 01fbd8d4c60d458ca9416289601211602689fc6e Mon Sep 17 00:00:00 2001 From: tueem Date: Sat, 19 Oct 2024 10:05:24 +0200 Subject: [PATCH] refactor with new directories --- Dockerfile | 21 +++++++++++++-------- archean_start.sh | 20 ++++++++++---------- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/Dockerfile b/Dockerfile index 63b128c..ab197bb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,18 @@ FROM xenon3d/archean-server-alpha +RUN rm -f /home/container RUN adduser --disabled-password --home /home/container container -USER container -ENV USER=container HOME=/home/container - WORKDIR /home/container -CMD ["/bin/bash", "/entrypoint.sh"] + +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 server/server.ini +COPY server.ini data/server/server.ini COPY entrypoint.sh /entrypoint.sh -USER root - -RUN chown -R container:container /home/container +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 @@ -22,3 +20,10 @@ RUN chmod -R 755 /Archean-data RUN chmod -R 755 /Archean-server-alpha USER container +ENV USER=container HOME=/home/container + +CMD ["/bin/bash", "/entrypoint.sh"] + + + + diff --git a/archean_start.sh b/archean_start.sh index 44d46ad..74e701a 100755 --- a/archean_start.sh +++ b/archean_start.sh @@ -1,12 +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 +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 +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 +sed "s/^listen_port=.*/listen_port=$SERVER_PORT/" data/server/server.ini > data/server/server.ini +sed "s/^spawn=.*/spawn=$SPAWN_PLANET/" data/server/server.ini > data/server/server.ini +sed "s/^auto_save_interval_seconds=.*/auto_save_interval_seconds=$AUTOSAVE_INTERVAL/" data/server/server.ini > data/server/server.ini +sed "s/^updates_per_second=.*/updates_per_second=$UPDATES_PER_SECOND/" data/server/server.ini > data/server/server.ini +sed "s/^physics_steps_per_update=.*/physics_steps_per_update=$PHYSICS_UPDATES_PER_UPDATE/" data/server/server.ini > data/server/server.ini \ No newline at end of file