Skip to content

Commit

Permalink
Merge branch 'release/0.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Deinhamer committed Jan 25, 2016
2 parents 0ef5966 + 28531c3 commit 9490550
Show file tree
Hide file tree
Showing 51 changed files with 1,182 additions and 273 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ indent_style = space
indent_size = 4
trim_trailing_whitespace = false

[*.{sh,yml}]
[*.yml]
indent_style = space
indent_size = 2

Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
# Development
/.vagrant/

# Project
/build/docker-compose.yml
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ services:
env:
- DOCKER_IMAGE_NAME=dstacademy/server

before_script: cd build
script:
- docker build -t $DOCKER_IMAGE_NAME .
- docker build -t $DOCKER_IMAGE_NAME ./build
- ./test/run.sh

notifications:
slack:
secure: mAg8knq5cIOmgAlPmK1Wcgid9qFvY5fTYIf84kVVnLNAF83soWaAEasSGBREVjMM3eJK+VeSCYBYkfC2exZyO1j6PuE3OylNw2TpaJU8i1+jaLAPXfxf8PZV8rCVmnol7CnH/m9qPWedZb+sOqpJcR+TL99rtvYLb5oVXcmHgSG+THoPgWJlGIGD4QYiZLA8HyZbJits/qePKH50RIG7MRH/BT8sV94iSodtdlMNjqN+0I7W+3pV6uZV5g21FjyyJvixzJmffN3sQfQ1w8asUFkW9fj+6LppyDDw+DD97Ln7Ld9Lqu3AytXGk/J9ADD065BV34eoSLxXhp+/SuMzYia2RQeoEXsG6jjEB+IIqyx8W/L0SmEVhoRwVgAXTgASxXM7L4bbLnBO4t96ZolYudYr4O4Dq3A2l5HkD8tNmpRwj6fr3jJFyisnEjktX4/hIi6WLRjbTFWpf43rQ5BAqoSwKahyQkgmoKUnjrcJzzOQuTOdDxnfB9afTsSh9tXyYuCHs92qtcHihLycLyO53OJif3XmRRHzV0Sn4blJQEoXYFwJ3eSlgMsqG/tunug4I6UbU7Q5DXyAGOoQEOWloUIQhDy9/wPD2JyyJkI7OF2ngOZP4O0hCepWSgBvG0Coz0TOES92BSd8uZNmZRtb/KZLQ9Kx9ZsRmq63VwNQPz8=
19 changes: 18 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@

## [next]

## [0.4.0]

### Added
- Add test cases to ensure code functionality.
- Introduce sub-commands `start`, `update`, `log` and `console`.
- Add `MODS_FORCE` variable to enable mods for development.

### Changed
- Relocate DST files in the image.
- Rename some environment variables for a more consistent naming scheme.
- Set `AUTOCOMPILER_ENABLE` to `false` by default.

### Removed
- Remove `UPDATE_ON_BOOT` environment variable.
- Remove `WORKDIR` directive from the Dockerfile.

## [0.3.0]

### Added
Expand Down Expand Up @@ -36,7 +52,8 @@
### Added
- Initial release.

[next]: https://github.com/dst-academy/server/compare/v0.3.0...HEAD
[next]: https://github.com/dst-academy/server/compare/v0.4.0...HEAD
[0.4.0]: https://github.com/dst-academy/server/compare/v0.3.0...v0.4.0
[0.3.0]: https://github.com/dst-academy/server/compare/v0.2.0...v0.3.0
[0.2.0]: https://github.com/dst-academy/server/compare/v0.1.0...v0.2.0
[0.1.0]: https://github.com/dst-academy/server/compare/da19beb5479033b82dd6dc1200bb0cf6724904c3...v0.1.0
41 changes: 41 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Contribution Guide
> Thank you for considering contributing to the project.
## Features and Bugs

Should you experience any bugs or have a feature wish, you can
let us know by [creating a new issue][issues-create] on GitHub.

Before creating a new issue search for existing issues.
Maybe it has already been reported by someone else.

## Pull Requests

We'd like to encourage you to contribute code and we do appreciate all help
on making this a better project. Especially look out for issues tagged with
[`contribution`][issues-contribute], which are free to grab and work on.
Give as a shout if you consider working on one.

To stay on track we ask you to respect the following **contribution rules**:

- Fork the repository when working on a feature or bugfix.
- Create PRs based on the `develop` branch.
- Use an `editorconfig` compliant editor and/or respect the [settings][file-editorconfig].
- Update the [`CHANGELOG`][file-changelog] and [`README`][file-readme] files if relevant.

## Contact

Feel free to contact us if you have questions or feedback.

- Join our [Slack Channel][contact-slack].
- Join our [Steam Group][contact-steam].
- Join our discussion on the [Klei Forums][contact-forums].

[issues-create]: https://github.com/dst-academy/server/issues/new/
[issues-contribute]: https://github.com/dst-academy/server/labels/contribution
[file-editorconfig]: https://github.com/dst-academy/server/blob/develop/.editorconfig
[file-readme]: https://github.com/dst-academy/server/blob/develop/README.md
[file-changelog]: https://github.com/dst-academy/server/blob/develop/CHANGELOG.md
[contact-slack]: http://slack.dst.academy/
[contact-steam]: https://steamcommunity.com/groups/dst-academy
[contact-forums]: http://forums.kleientertainment.com/topic/61674-custom-dedicated-server-with-docker/
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# DST:A Dedicated Server [![Build Status](https://travis-ci.org/dst-academy/server.svg?branch=develop)](https://travis-ci.org/dst-academy/server) [![Docker Pulls](https://img.shields.io/docker/pulls/dstacademy/server.svg)](https://hub.docker.com/r/dstacademy/server/)
# DST:A Dedicated Server [![Build Status](https://travis-ci.org/dst-academy/server.svg?branch=develop)](https://travis-ci.org/dst-academy/server) [![Docker Pulls](https://img.shields.io/docker/pulls/dstacademy/server.svg)](https://hub.docker.com/r/dstacademy/server/) [![Slack Status](http://slack.dst.academy/badge.svg)](http://slack.dst.academy/)
> Don't Starve Together Academy Dedicated Server for Docker.
This repository provides a `Dockerfile` for building the DST:A Dedicated Server
Expand All @@ -23,10 +23,11 @@ If you want to set up your own server, have a look at the [DST:A Suite][suite].
- [Configuration][docs-configuration]
- [Usage][docs-usage]

## Frequently Asked Questions
## Contribution
Do you want to contribute to the project?
Check out our [contribution guide][contribution-guide].

- **Does Docker automatically restart a running DST:A Dedicated Server when the host-system is rebooted?**
Yes.
## Frequently Asked Questions

- **On which operating systems can I run Docker and the DST:A Dedicated Server?**
Docker runs natively on Linux, but there are official solutions for running Docker on Windows and OSX.
Expand All @@ -48,6 +49,7 @@ If you want to set up your own server, have a look at the [DST:A Suite][suite].
[docs-usage]: /docs/usage.md
[website]: http://www.dontstarvetogether.com/
[suite]: https://github.com/dst-academy/suite
[contribution-guide]: /CONTRIBUTING.md
[docker-kitematic]: https://kitematic.com/
[docker-toolbox]: https://www.docker.com/docker-toolbox
[reference-dedicated]: http://forums.kleientertainment.com/forum/83-dont-starve-together-beta-dedicated-server-discussion/
Expand Down
99 changes: 63 additions & 36 deletions build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,70 +4,97 @@ MAINTAINER Thomas Deinhamer <[email protected]>
# Install dependencies.
RUN dpkg --add-architecture i386 \
&& apt-get update -y \
&& apt-get install -y --no-install-recommends ca-certificates curl lib32gcc1 lib32stdc++6 libcurl4-gnutls-dev:i386 \
&& apt-get install -y --no-install-recommends \
ca-certificates \
curl \
lib32gcc1 \
lib32stdc++6 \
libcurl4-gnutls-dev:i386 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& gpg --keyserver pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
&& curl -o /usr/local/bin/gosu -fSL "https://github.com/tianon/gosu/releases/download/1.7/gosu-$(dpkg --print-architecture)" \
&& curl -o /usr/local/bin/gosu.asc -fSL "https://github.com/tianon/gosu/releases/download/1.7/gosu-$(dpkg --print-architecture).asc" \
&& rm -rf /var/lib/apt/lists/*

# Install gosu.
RUN gpg --keyserver pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
&& curl -o /usr/local/bin/gosu -fsSL "https://github.com/tianon/gosu/releases/download/1.7/gosu-$(dpkg --print-architecture)" \
&& curl -o /usr/local/bin/gosu.asc -fsSL "https://github.com/tianon/gosu/releases/download/1.7/gosu-$(dpkg --print-architecture).asc" \
&& gpg --verify /usr/local/bin/gosu.asc \
&& rm /usr/local/bin/gosu.asc \
&& chmod +x /usr/local/bin/gosu

ENV STEAM_HOME="/opt/steam" \
DST_HOME="/opt/dst" \
DSTA_HOME="/usr/local/lib/dsta" \
CONFIG_PATH="/var/lib/dsta/config"

# Add steam user.
RUN adduser --home /var/lib/steam --disabled-login --gecos "Steam" steam
RUN adduser --disabled-login --gecos "Steam" --home $STEAM_HOME steam

# Install SteamCMD.
RUN gosu steam mkdir -p /var/lib/steam/steamcmd/ \
&& curl -SL "http://media.steampowered.com/installer/steamcmd_linux.tar.gz" | gosu steam tar -xzvC /var/lib/steam/steamcmd \
&& chmod 744 /var/lib/steam/steamcmd/steamcmd.sh \
&& gosu steam /var/lib/steam/steamcmd/steamcmd.sh \
RUN curl -fsSL "https://cdn.steamstatic.com/client/installer/steamcmd_linux.tar.gz" | gosu steam tar -xzvC $STEAM_HOME \
&& gosu steam $STEAM_HOME/steamcmd.sh \
+@ShutdownOnFailedCommand 1 \
+quit
+quit \
&& rm -rf $STEAM_HOME/Steam/logs $STEAM_HOME/Steam/appcache/httpcache \
&& find $STEAM_HOME/package -type f ! -name "steam_cmd_linux.installed" ! -name "steam_cmd_linux.manifest" -delete

# Install Don't Starve Together Server.
COPY /update_dst.sh /var/lib/steam/
RUN chown steam:steam /var/lib/steam/update_dst.sh \
RUN mkdir -p $DST_HOME \
&& chown steam:steam $DST_HOME \
&& sync \
&& /var/lib/steam/update_dst.sh
&& gosu steam $STEAM_HOME/steamcmd.sh \
+@ShutdownOnFailedCommand 1 \
+login anonymous \
+force_install_dir $DST_HOME \
+app_update 343050 validate \
+quit \
&& rm -rf $STEAM_HOME/Steam/logs $STEAM_HOME/Steam/appcache/httpcache \
&& find $STEAM_HOME/package -type f ! -name "steam_cmd_linux.installed" ! -name "steam_cmd_linux.manifest" -delete

# Copy common scripts.
COPY /script/* /usr/local/bin/

# Add dsta user.
RUN adduser --home /var/lib/dsta --disabled-login --gecos "DST Academy" dsta
# Copy entrypoint script.
COPY /docker-entrypoint.sh /entrypoint.sh

# Copy static files.
COPY /static $DSTA_HOME
RUN mkfifo $DSTA_HOME/console \
&& chown -R steam:steam $DSTA_HOME \
&& mkdir -p `dirname $CONFIG_PATH` \
&& chown steam:steam `dirname $CONFIG_PATH`

# Set environment variables.
ENV UPDATE_ON_BOOT=true \
DEFAULT_SERVER_NAME= \
DEFAULT_SERVER_DESCRIPTION="Powered by DST Academy." \
ENV SERVER_DESCRIPTION="Powered by DST Academy." \
SERVER_PORT=10999 \
OFFLINE_SERVER=false \
OFFLINE_ENABLE=false \
MAX_PLAYERS=4 \
WHITELIST_SLOTS=0 \
PVP=false \
PVP_ENABLE=false \
GAME_MODE=survival \
SERVER_INTENTION=cooperative \
ENABLE_AUTOSAVER=true \
AUTOSAVER_ENABLE=true \
TICK_RATE=15 \
CONNECTION_TIMEOUT=5000 \
ENABLE_VOTE_KICK=true \
VOTE_KICK_ENABLE=true \
PAUSE_WHEN_EMPTY=true \
STEAM_AUTHENTICATION_PORT=8766 \
STEAM_MASTER_SERVER_PORT=27016 \
STEAM_GROUP_ONLY=false \
STEAM_GROUP_ADMINS=false \
CONSOLE_ENABLED=true \
AUTOCOMPILER_ENABLED=true \
MODS_ENABLED=true \
CONSOLE_ENABLE=true \
AUTOCOMPILER_ENABLE=false \
MODS_ENABLE=true \
SHARD_ENABLE=false \
IS_MASTER=false \
BIND_IP="0.0.0.0" \
DISABLECLOUD=true

# Add entrypoint script.
COPY /entrypoint.sh /adjectives.txt /names.txt /var/lib/dsta/
RUN chown dsta:dsta -R /var/lib/dsta/
SHARD_IS_MASTER=false \
SHARD_BIND_IP="0.0.0.0" \
STEAM_CLOUD_DISABLE=true

# Expose default server port.
EXPOSE 10999/udp
VOLUME ["/var/lib/dsta/server"]

WORKDIR /var/lib/steam/DoNotStarveTogether/bin/
ENTRYPOINT ["/var/lib/dsta/entrypoint.sh"]
# Set up a volume for configuration files.
VOLUME ["$CONFIG_PATH"]

# Set entrypoint and default command.
ENTRYPOINT ["/entrypoint.sh"]
CMD ["dst-server", "start"]
51 changes: 0 additions & 51 deletions build/docker-compose.dist.yml

This file was deleted.

15 changes: 15 additions & 0 deletions build/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

if [ $1 == "dst-server" ]; then
set -e

# Configure the server
chown steam:steam $CONFIG_PATH

$DSTA_HOME/boot/settings.sh
$DSTA_HOME/boot/lists.sh
$DSTA_HOME/boot/world.sh
$DSTA_HOME/boot/mods.sh
fi

exec "$@"
Loading

0 comments on commit 9490550

Please sign in to comment.