Added local host file functionality

This commit is contained in:
LiamAEdwards
2023-10-08 16:36:56 +00:00
parent 473bf4d2fa
commit 1196bb6f7e
2 changed files with 20 additions and 6 deletions

View File

@@ -7,20 +7,20 @@ RUN apt-get -y update && \
# Download and extract SS14 server
ADD https://cdn.centcomm.spacestation14.com/builds/wizards/builds/70246ae10eff287ca83193cce73b79e7424c7e4a/SS14.Server_linux-x64.zip SS14.Server_linux-x64.zip
RUN unzip SS14.Server_linux-x64.zip -d /ss14/
RUN unzip SS14.Server_linux-x64.zip -d /ss14-default/
# Download and build Watchdog
RUN wget https://github.com/space-wizards/SS14.Watchdog/archive/d0a68202284e837e987d38b3e99f15a6a53f2a0b.zip -O Watchdog.zip && \
unzip Watchdog.zip -d Watchdog && \
cd Watchdog/SS14* && \
dotnet publish -c Release -r linux-x64 --no-self-contained && \
cp -r SS14.Watchdog/bin/Release/net7.0/linux-x64/publish /ss14
cp -r SS14.Watchdog/bin/Release/net7.0/linux-x64/publish /ss14-default
# Server stage
FROM mcr.microsoft.com/dotnet/runtime:7.0 AS server
# Copy from the build stage
COPY --from=build /ss14 /ss14
COPY --from=build /ss14-default /ss14-default
# Install necessary tools
RUN apt-get -y update && apt-get -y install unzip
@@ -35,8 +35,11 @@ EXPOSE 5000/udp
VOLUME [ "/ss14" ]
# Add configurations
ADD appsettings.yml /ss14/appsettings.yml
ADD server_config.toml /ss14/server_config.toml
ADD appsettings.yml /ss14-default/appsettings.yml
ADD server_config.toml /ss14-default/server_config.toml
COPY start.sh /start.sh
RUN chmod +x /start.sh
# Set the entry point for the container
ENTRYPOINT ["/ss14/Robust.Server"]
ENTRYPOINT ["/start.sh"]

11
start.sh Normal file
View File

@@ -0,0 +1,11 @@
#!/bin/sh
# Check if directory is empty
if [ ! "$(ls -A /ss14)" ]; then
# Copy the default files
cp -R /ss14-default/* /ss14/
fi
# Start the original command
exec /ss14/Robust.Server "$@"