forked from Didstopia/terraria-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
78 lines (75 loc) · 2.85 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# Based on ryansheehan's work here:
# https://github.com/ryansheehan/terraria/blob/master/tshock/Dockerfile
# Build TShock
FROM mono:6.8 AS tshock
LABEL maintainer="Didstopia <[email protected]>"
ENV TSHOCK_VERSION=v4.4.0-pre13
ENV BUILD_MODE=Release
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y \
git && \
nuget update -self
RUN git clone --recurse-submodules -j8 --depth 1 --branch ${TSHOCK_VERSION} https://github.com/Pryaxis/TShock.git /app
WORKDIR /app
RUN nuget restore ./TerrariaServerAPI/ && \
msbuild ./TerrariaServerAPI/TShock.4.OTAPI.sln /p:Configuration=$BUILD_MODE && \
cd ./TerrariaServerAPI/TShock.Modifications.Bootstrapper/bin/$BUILD_MODE/ && \
mono TShock.Modifications.Bootstrapper.exe -in=OTAPI.dll \
-mod=../../../TShock.Modifications.**/bin/$BUILD_MODE/TShock.Modifications.*.dll \
-o=Output/OTAPI.dll && \
cd ./../../../../ && \
msbuild ./TerrariaServerAPI/TerrariaServerAPI/TerrariaServerAPI.csproj \
/p:Configuration=$BUILD_MODE && \
nuget restore && \
xbuild ./TShock.sln /p:Configuration=$BUILD_MODE
# Build Terracord
FROM mono:6.8 AS terracord
LABEL maintainer="Didstopia <[email protected]>"
ENV BUILD_MODE=Release
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y \
git && \
nuget update -self
RUN git clone --recurse-submodules -j8 --depth 1 --branch master https://github.com/FragLand/terracord.git /app && \
cd /app && \
git checkout f034948040889602095053b8e401d8b4efef3c83
WORKDIR /app
RUN mkdir -p /app/lib
COPY --from=tshock /app/TShockAPI/bin/${BUILD_MODE}/ /app/lib/
RUN nuget restore && \
msbuild /p:Configuration=${BUILD_MODE},TargetFrameworks=net46 Terracord/Terracord.csproj
FROM mono:6.8
LABEL maintainer="Didstopia <[email protected]>"
ENV BUILD_MODE=Release
ENV CONFIG_PATH=/tshock/worlds
ENV LOG_PATH=/tshock/logs
ENV WORLD_FILENAME=""
ENV TERRACORD_ENABLED=false
ENV TERRACORD_SILENCE_BROADCASTS=true
ENV TERRACORD_SILENCE_CHAT=false
ENV TERRACORD_SILENCE_SAVES=true
ENV TERRACORD_ANNOUNCE_RECONNECT=false
ENV TERRACORD_EMOJI_JOIN=":green_circle:"
ENV TERRACORD_EMOJI_LEAVE=":red_circle:"
EXPOSE 7777 7878
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y \
screen \
procps \
bash \
xmlstarlet
WORKDIR /tshock
VOLUME ["/tshock/worlds", "/tshock/logs", "/plugins"]
RUN mkdir -p /tshock/ServerPlugins/ && \
mkdir -p /tshock/tshock/Terracord
COPY entrypoint.sh /tshock/entrypoint.sh
COPY --from=terracord /app/Terracord/bin/${BUILD_MODE}/net46/ /tshock/
COPY --from=terracord /app/Terracord/bin/${BUILD_MODE}/net46/TShockAPI.dll /tshock/ServerPlugins/
COPY --from=terracord /app/terracord.xml /tshock/tshock/Terracord/
RUN chmod +x /tshock/entrypoint.sh && \
chmod +x /tshock/TerrariaServer.exe && \
rm -fr /tshock/TShockAPI.dll
ENTRYPOINT [ "/bin/sh", "entrypoint.sh" ]