-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
bskrtich-ci
committed
May 10, 2023
1 parent
73c8ed1
commit 6b60c19
Showing
4 changed files
with
63 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
FROM mcr.microsoft.com/dotnet/runtime:6.0 | ||
|
||
# Update and install needed utils | ||
RUN apt-get update && \ | ||
apt-get upgrade -y && \ | ||
apt-get install -y curl nuget vim zip && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Create symbolic link to ServerLog.txt | ||
RUN mkdir /config /tshock && \ | ||
touch /config/ServerLog.txt && \ | ||
ln -s /config/ServerLog.txt /tshock/ServerLog.txt && \ | ||
rm -rf /config | ||
|
||
# fix for favorites.json error | ||
RUN favorites_path="/root/My Games/Terraria" && mkdir -p "$favorites_path" && echo "{}" > "$favorites_path/favorites.json" | ||
|
||
RUN cd /tmp && \ | ||
curl -sL https://github.com/Pryaxis/TShock/releases/download/v5.2.0/TShock-5.2-for-Terraria-1.4.4.9-linux-x64-Release.zip --output tshock_release.zip && \ | ||
unzip tshock_release.zip -d /tmp/tshock && \ | ||
cd /tmp/tshock && \ | ||
mkdir ./untar && tar -xf *.tar -C ./untar && \ | ||
cd $(find . -type f -name TShock.Server -printf '%h\n') && \ | ||
mv ./* /tshock/ && \ | ||
rm -R /tmp/* | ||
|
||
COPY run-tshock.sh /tshock/run.sh | ||
|
||
# Metadata | ||
ARG VCS_REF | ||
LABEL org.label-schema.vcs-ref=$VCS_REF | ||
LABEL org.label-schema.vcs-url="https://github.com/beardedio/terraria" | ||
LABEL org.opencontainers.image.source=https://github.com/beardedio/terraria | ||
LABEL org.opencontainers.image.licenses=MIT | ||
LABEL org.opencontainers.image.description="Tshock Terraria Server - Version 5.2.0" | ||
LABEL TSHOCK_VERSION=5.2.0 | ||
|
||
# Allow for external data | ||
VOLUME ["/config", "/tshock/ServerPlugins"] | ||
|
||
# Run the server | ||
WORKDIR /tshock | ||
ENTRYPOINT ["./run.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
CMD="./TShock.Server -configpath /config -worldpath /config -worldselectpath /config -logpath /config" | ||
|
||
# Pass in world if set | ||
if [ "${world:-null}" != null ]; then | ||
if [ ! -f "/config/$world" ]; then | ||
echo "World file does not exist! Quitting..." | ||
exit 1 | ||
fi | ||
CMD="$CMD -world /config/$world" | ||
fi | ||
|
||
echo "Starting container, CMD: $CMD $@" | ||
exec $CMD $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
5.1.3 | ||
5.2.0 |