Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
741874e
updating to new terraria and tmod version
JoeStratton May 17, 2020
9cc702c
addingt travis testing back in
JoeStratton May 17, 2020
77fda3a
adding unzip rather than tar for tmod files
JoeStratton May 17, 2020
c45e6bd
adding zip arguments to tmodload server
JoeStratton May 17, 2020
c15b1d1
fixng new file structure for tmodloader 11.7
JoeStratton May 17, 2020
4776926
updated base image version to solve error code
JoeStratton May 17, 2020
e5da61c
fixed unzip error with forced overwrite -o
JoeStratton May 17, 2020
4dc3406
updating tmod and terraria - still broken until tmod updates
JoeStratton May 18, 2020
2ebcec7
updating tmod and terraria - still broken until tmod updates
JoeStratton May 18, 2020
029228d
updating tmod and terraria - still broken until tmod updates
JoeStratton May 18, 2020
b8ac335
updated terraria server download url, note this will still not work u…
JoeStratton May 18, 2020
c01090c
fixed variable note- still needs tmodloader update to function
JoeStratton May 18, 2020
598548c
simplyfing travis pipeline
JoeStratton May 18, 2020
c16fd80
simplyfing travis pipeline
JoeStratton May 18, 2020
0c49a50
Update README.md
JoeStratton May 18, 2020
61bc54c
cleanup before hibernating for tmod upates
JoeStratton May 20, 2020
e4785f3
Merge branch 'master' of github.com:JoeStratton/tmodloader-docker
JoeStratton May 20, 2020
f85553c
updating to working versions
JoeStratton Jun 8, 2020
7e6e4e5
updating to working versions
JoeStratton Jun 8, 2020
7b799ef
updating to working versions
JoeStratton Jun 8, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
language: python
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't used travis before. Does this push to docker hub or does travis have it's own private registry used for testing?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you have to set your environment variables you see referenced in the travis UI itself with your docker hub credentials. It does not have a local registry. This builds the container and pushes it, then tests it by pulling and running it.


services:
- docker

jobs:
include:
- stage: Build and Push Docker Image
script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker build -t tmodloader-docker .
- docker images
- docker tag tmodloader-docker $DOCKER_USERNAME/tmodloader-docker
- docker push $DOCKER_USERNAME/tmodloader-docker
- stage: Run Docker Image
script:
- docker run -d --name Terraria -p 7777:7777 -v /etc/localtime:/etc/localtime:ro $DOCKER_USERNAME/tmodloader-docker
- docker ps -a
92 changes: 46 additions & 46 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
FROM frolvlad/alpine-glibc:alpine-3.10 as build

ARG TMOD_VERSION=0.11.6.2
ARG TERRARIA_VERSION=1353

RUN apk update &&\
apk add --no-cache --virtual build curl unzip &&\
apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing mono

WORKDIR /terraria-server

RUN cp /usr/lib/libMonoPosixHelper.so .

RUN curl -SLO "http://terraria.org/server/terraria-server-${TERRARIA_VERSION}.zip" &&\
unzip terraria-server-*.zip &&\
rm terraria-server-*.zip &&\
cp --verbose -a "${TERRARIA_VERSION}/Linux/." . &&\
rm -rf "${TERRARIA_VERSION}" &&\
rm TerrariaServer.bin.x86 TerrariaServer.exe

RUN curl -SL "https://github.com/tModLoader/tModLoader/releases/download/v${TMOD_VERSION}/tModLoader.Linux.v${TMOD_VERSION}.tar.gz" | tar -xvz &&\
chmod u+x tModLoaderServer* Terraria TerrariaServer.* &&\
mv TerrariaServer.bin.x86_64 tModLoaderServer.bin.x86_64 &&\
rm *.txt *.jar

FROM frolvlad/alpine-glibc:alpine-3.10

WORKDIR /terraria-server
COPY --from=build /terraria-server ./

RUN apk update &&\
apk add --no-cache procps tmux
RUN ln -s ${HOME}/.local/share/Terraria/ /terraria
COPY inject.sh /usr/local/bin/inject
COPY handle-idle.sh /usr/local/bin/handle-idle

EXPOSE 7777
ENV TMOD_SHUTDOWN_MSG="Shutting down!"
ENV TMOD_AUTOSAVE_INTERVAL="*/10 * * * *"
ENV TMOD_IDLE_CHECK_INTERVAL=""
ENV TMOD_IDLE_CHECK_OFFSET=0

COPY config.txt entrypoint.sh ./
RUN chmod +x entrypoint.sh /usr/local/bin/inject /usr/local/bin/handle-idle

ENTRYPOINT [ "/terraria-server/entrypoint.sh" ]
FROM frolvlad/alpine-glibc:alpine-3.11 as build
ARG TMOD_VERSION=0.11.7.5
ARG TERRARIA_VERSION=1405
RUN apk update &&\
apk add --no-cache --virtual build curl unzip &&\
apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing mono
WORKDIR /terraria-server
RUN cp /usr/lib/libMonoPosixHelper.so .
RUN curl -SLO "https://www.terraria.org/system/dedicated_servers/archives/000/000/039/original/terraria-server-${TERRARIA_VERSION}.zip" &&\
unzip terraria-server-*.zip &&\
rm terraria-server-*.zip &&\
cp --verbose -a "${TERRARIA_VERSION}/Linux/." . &&\
rm -rf "${TERRARIA_VERSION}" &&\
rm TerrariaServer.bin.x86 TerrariaServer.exe
RUN curl -SLO "https://github.com/tModLoader/tModLoader/releases/download/v${TMOD_VERSION}/tModLoader.Linux.v${TMOD_VERSION}.zip" &&\
unzip -o tModLoader.Linux.v*.zip &&\
rm tModLoader.Linux.v*.zip &&\
chmod u+x tModLoaderServer*
FROM frolvlad/alpine-glibc:alpine-3.11
WORKDIR /terraria-server
COPY --from=build /terraria-server ./
RUN apk update &&\
apk add --no-cache procps tmux
RUN ln -s ${HOME}/.local/share/Terraria/ /terraria
COPY inject.sh /usr/local/bin/inject
COPY handle-idle.sh /usr/local/bin/handle-idle
EXPOSE 7777
ENV TMOD_SHUTDOWN_MSG="Shutting down!"
ENV TMOD_AUTOSAVE_INTERVAL="*/10 * * * *"
ENV TMOD_IDLE_CHECK_INTERVAL=""
ENV TMOD_IDLE_CHECK_OFFSET=0
COPY config.txt entrypoint.sh ./
RUN chmod +x entrypoint.sh /usr/local/bin/inject /usr/local/bin/handle-idle
ENTRYPOINT [ "/terraria-server/entrypoint.sh" ]
27 changes: 13 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@

[tModLoader] dedicated server

Terraria server 1.3.5.3 with tModLoader v0.11.6.2.
Terraria server 1.4.0.5 with tModLoader v0.11.7.5

Supports graceful shutdown (saves when the container receives a stop command) and also supports autosaving every 10 minutes (configurable, see [Environment Variables] below).

## Quick Start

docker run -d --name tmod -p 7777:7777 -v /etc/localtime:/etc/localtime:ro rfvgyhn/tmodloader
docker run -d --name tmod -p 7777:7777 -v /etc/localtime:/etc/localtime:ro j123ss/tmodloader-docker

# Adding worlds

docker run -d --name tmod -p 7777:7777 -v /etc/localtime:/etc/localtime:ro -v $(pwd)/data:/terraria rfvgyhn/tmodloader
docker run -d --name tmod -p 7777:7777 -v /etc/localtime:/etc/localtime:ro -v $(pwd)/data:/terraria j123ss/tmodloader-docker

# Server Config File

You can mount a config file. This allows you to specify server and world settings. If you don't specify one, a [default] will be used. See [wiki] for file format details.

docker run -d --name tmod -p 7777:7777 -v /etc/localtime:/etc/localtime:ro -v $(pwd)/data:/terraria -v $(pwd)/config.txt:/terraria-server/config.txt rfvgyhn/tmodloader
docker run -d --name tmod -p 7777:7777 -v /etc/localtime:/etc/localtime:ro -v $(pwd)/data:/terraria -v $(pwd)/config.txt:/terraria-server/config.txt j123ss/tmodloader-docker

# Initial Setup

If you want to use the server's mod browser to install and enable mods, run an interactive container with the `setup` parameter appended to the end.

docker run -it --rm -v $(pwd)/data:/terraria rfvgyhn/tmodloader setup
docker run -it --rm -v $(pwd)/data:/terraria j123ss/tmodloader-docker setup

After setting up your mods, and optionally setting up a world, press `Ctrl+C` to exit the container. Then you can use the normal docker command to run your server. Note that you'll see the mods and the `enabled.json` files appear in your mods folder on the host.

Expand Down Expand Up @@ -54,14 +54,14 @@ TMOD_IDLE_CHECK_OFFSET | 0 | This allows for sub-minute resolutio
-e TMOD_IDLE_CHECK_OFFSET=10 \
-p 7777:7777 \
-v /etc/localtime:/etc/localtime:ro \
rfvgyhn/tmodloader
j123ss/tmodloader-docker

# Sample Docker Compose

version: '3'
services:
tmod:
image: 'rfvgyhn/tmodloader:latest'
image: 'j123ss/tmodloader-docker:latest'
container_name: 'tmod'
ports:
- '7777:7777'
Expand All @@ -75,12 +75,11 @@ TMOD_IDLE_CHECK_OFFSET | 0 | This allows for sub-minute resolutio
[tModLoader]: https://www.tmodloader.net/
[wiki]: https://terraria.gamepedia.com/Server#Server_config_file
[commands]: https://terraria.gamepedia.com/Server#List_of_console_commands
[tMod Version]: https://img.shields.io/badge/tMod-0.11.6.2-blue
[Terraria Version]: https://img.shields.io/badge/Terraria-1.3.5.3-blue
[Docker Stars]: https://img.shields.io/docker/stars/rfvgyhn/tmodloader.svg
[Docker Pulls]: https://img.shields.io/docker/pulls/rfvgyhn/tmodloader.svg
[default]: https://github.com/Rfvgyhn/tmodloader-docker/blob/master/config.txt
[tMod Version]: https://img.shields.io/badge/tMod-0.11.7.5-blue
[Terraria Version]: https://img.shields.io/badge/Terraria-1.4.0.5-blue
[Docker Stars]: https://img.shields.io/docker/stars/j123ss/tmodloader-docker.svg
[Docker Pulls]: https://img.shields.io/docker/pulls/j123ss/tmodloader-docker.svg
[default]: https://github.com/j123ss/tmodloader-docker-docker/blob/master/config.txt
[directly]: https://github.com/tModLoader/tModLoader/wiki/Mod-Browser#direct-download
[Environment Variables]: #environment-variables
[game-manager]: https://hub.docker.com/r/rfvgyhn/game-manager/
[0]: https://hub.docker.com/r/rfvgyhn/tmodloader
[0]: https://hub.docker.com/r/j123ss/tmodloader-docker