Modernized TShock config

This commit is contained in:
Jef Roosens 2021-04-23 15:16:51 +02:00
parent 608b4fbe90
commit 3411f3d0a9
Signed by: Jef Roosens
GPG key ID: B580B976584B5F30
5 changed files with 30 additions and 98 deletions

View file

@ -1,49 +1,27 @@
# Copyright (C) 2020 Jef Roosens
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
FROM alpine:latest AS base
FROM alpine:3.13.5 AS base
# Build arguments
ARG RELEASE_TAG
# Add unzip & curl
RUN apk update && apk add --no-cache unzip curl
WORKDIR /terraria
# Download & unzip
# TODO convert this to jq?
RUN curl -s "https://api.github.com/repos/Pryaxis/TShock/releases/tags/${RELEASE_TAG}" | \
grep "browser_download_url" | \
grep -o "https[^\"]\+" | \
xargs curl -sLo tshock.zip && \
unzip tshock.zip && \
rm tshock.zip && \
# Is there a better way to do this?
mv TShock* tshock
RUN apk update && apk add --no-cache unzip curl && \
curl -s "https://api.github.com/repos/Pryaxis/TShock/releases/tags/${RELEASE_TAG}" | \
grep "browser_download_url" | \
grep -o "https[^\"]\+" | \
xargs curl -sLo tshock.zip && \
unzip -d tshock tshock.zip && \
rm tshock.zip
FROM mono:latest
FROM mono:6.12.0.107
WORKDIR /terraria
COPY --from=base /terraria/tshock /terraria
# Create worlds directory & symlink it
RUN mkdir -p worlds logs config /root/.local/share/Terraria && \
ln -s /terraria/worlds /root/.local/share/Terraria/Worlds
ln -s /terraria/worlds /root/.local/share/Terraria/Worlds
ENTRYPOINT \
mono /terraria/TerrariaServer.exe \