diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..6439ce4 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,18 @@ +language: python + +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 diff --git a/Dockerfile b/Dockerfile index c35d68a..6574837 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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" ] diff --git a/README.md b/README.md index ff66882..48e9e09 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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' @@ -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 \ No newline at end of file +[0]: https://hub.docker.com/r/j123ss/tmodloader-docker