-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
46 changed files
with
430 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +0,0 @@ | ||
# Development | ||
/.vagrant/ | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,67 @@ | ||
FROM dstacademy/steamcmd:0.1 | ||
FROM dstacademy/steamcmd:0.2.1 | ||
MAINTAINER DST Academy <[email protected]> | ||
|
||
# Install dependencies. | ||
RUN dpkg --add-architecture i386 \ | ||
&& apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
lib32stdc++6 \ | ||
libcurl4-gnutls-dev:i386 \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Define build arguments. | ||
# Set build arguments. | ||
ARG DST_HOME | ||
ENV DST_HOME ${DST_HOME:-"/opt/dst"} | ||
ARG DST_BRANCH | ||
ENV DST_BRANCH ${DST_BRANCH} | ||
ARG DST_BRANCH_PASSWORD | ||
ENV DST_BRANCH_PASSWORD ${DST_BRANCH_PASSWORD} | ||
ARG DSTA_HOME | ||
ENV DSTA_HOME ${DSTA_HOME:-"/usr/local/share/dsta"} | ||
ARG CLUSTER_PATH | ||
ENV CLUSTER_PATH ${CLUSTER_PATH:-"/var/lib/dsta/cluster"} | ||
|
||
# Set environment variables. | ||
ENV DESCRIPTION="Powered by DST Academy." \ | ||
SERVER_PORT="10999" \ | ||
SHARD_NAME=shard \ | ||
SHARD_BIND_IP="0.0.0.0" \ | ||
BACKUP_LOG_COUNT=0 | ||
|
||
# Install dependencies. | ||
RUN set -x \ | ||
&& dpkg --add-architecture i386 \ | ||
&& apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
lib32stdc++6 \ | ||
libcurl4-gnutls-dev:i386 \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
# Install Don't Starve Together Server. | ||
RUN mkdir -p $DST_HOME \ | ||
RUN set -x \ | ||
&& mkdir -p $DST_HOME \ | ||
&& chown $STEAM_USER:$STEAM_USER $DST_HOME \ | ||
&& sync \ | ||
&& gosu $STEAM_USER $STEAM_HOME/steamcmd.sh \ | ||
&& gosu $STEAM_USER steamcmd \ | ||
+@ShutdownOnFailedCommand 1 \ | ||
+login anonymous \ | ||
+force_install_dir $DST_HOME \ | ||
+app_update 343050 validate \ | ||
+app_update 343050 \ | ||
$([ -n "$DST_BRANCH" ] && printf %s "-beta $DST_BRANCH") \ | ||
$([ -n "$DST_BRANCH_PASSWORD" ] && printf %s "-betapassword $DST_BRANCH_PASSWORD") \ | ||
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/ | ||
|
||
# Copy entrypoint script. | ||
COPY /docker-entrypoint.sh /entrypoint.sh | ||
|
||
# Copy static files. | ||
COPY /static $DSTA_HOME | ||
RUN mkfifo $DSTA_HOME/console \ | ||
|
||
# Create pipe for the game console. | ||
RUN set -x \ | ||
&& mkfifo $DSTA_HOME/console \ | ||
&& chown -R $STEAM_USER:$STEAM_USER $DSTA_HOME \ | ||
&& mkdir -p `dirname $CLUSTER_PATH` \ | ||
&& chown $STEAM_USER:$STEAM_USER `dirname $CLUSTER_PATH` | ||
&& mkdir -p $(dirname $CLUSTER_PATH) \ | ||
&& chown $STEAM_USER:$STEAM_USER $(dirname $CLUSTER_PATH) | ||
|
||
# Set environment variables. | ||
ENV DESCRIPTION="Powered by DST Academy." \ | ||
SERVER_PORT="10999" \ | ||
MAX_PLAYERS=4 \ | ||
GAME_MODE=survival \ | ||
VOTE_KICK_ENABLE=true \ | ||
PAUSE_WHEN_EMPTY=true \ | ||
SHARD_NAME=shard \ | ||
SHARD_IS_MASTER=false \ | ||
SHARD_BIND_IP="0.0.0.0" \ | ||
BACKUP_LOG_COUNT=0 | ||
# Copy entrypoint script. | ||
COPY /docker-entrypoint.sh / | ||
|
||
# Expose default server port. | ||
EXPOSE $SERVER_PORT/udp | ||
|
@@ -63,5 +70,5 @@ EXPOSE $SERVER_PORT/udp | |
VOLUME ["$CLUSTER_PATH"] | ||
|
||
# Set entrypoint and default command. | ||
ENTRYPOINT ["/entrypoint.sh"] | ||
ENTRYPOINT ["/docker-entrypoint.sh"] | ||
CMD ["dst-server", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,23 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [ $1 == "dst-server" ]; then | ||
set -e | ||
# Exit immediately on non-zero return codes. | ||
set -e | ||
|
||
# Configure the server | ||
# Run start command if only options given. | ||
if [ "${1:0:1}" = '-' ]; then | ||
set -- dst-server start "$@" | ||
fi | ||
|
||
# Run boot scripts before starting the server. | ||
if [ "$1" = 'dst-server' ]; then | ||
|
||
# Prepare the shard directory. | ||
mkdir -p $CLUSTER_PATH/$SHARD_NAME | ||
chown -R $STEAM_USER:$STEAM_USER $CLUSTER_PATH | ||
|
||
if [ "$2" == "start" ]; then | ||
$DSTA_HOME/boot/token.sh | ||
$DSTA_HOME/boot/settings.sh | ||
$DSTA_HOME/boot/lists.sh | ||
$DSTA_HOME/boot/world.sh | ||
$DSTA_HOME/boot/mods.sh | ||
fi | ||
# Run via steam user if the command is `dst-server`. | ||
set -- gosu $STEAM_USER "$@" | ||
fi | ||
|
||
# Execute the command. | ||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.