-
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
105 changed files
with
3,024 additions
and
1,029 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
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,6 +1,16 @@ | ||
FROM dstacademy/steamcmd:0.2.1 | ||
FROM dstacademy/steamcmd:0.3 | ||
MAINTAINER DST Academy <[email protected]> | ||
|
||
# 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/* | ||
|
||
# Set build arguments. | ||
ARG DST_HOME | ||
ENV DST_HOME ${DST_HOME:-"/opt/dst"} | ||
|
@@ -23,16 +33,6 @@ ENV DESCRIPTION="Powered by DST Academy." \ | |
# Add labels. | ||
LABEL academy.dst.config.update="true" | ||
|
||
# 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 set -x \ | ||
&& mkdir -p $DST_HOME \ | ||
|
@@ -50,6 +50,19 @@ RUN set -x \ | |
&& 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 | ||
|
||
ARG MODS | ||
ENV MODS ${MODS} | ||
|
||
# Install mods. | ||
RUN set -x \ | ||
&& if [ -n "$MODS" ] ; then \ | ||
IFS="," \ | ||
&& for mod in $MODS; do echo "ServerModSetup(\"$mod\")" >> "$DST_HOME/mods/dedicated_server_mods_setup.lua"; done \ | ||
&& cd "$DST_HOME/bin" \ | ||
&& gosu $STEAM_USER ./dontstarve_dedicated_server_nullrenderer -only_update_server_mods \ | ||
&& rm -r "$STEAM_HOME/.klei" \ | ||
; fi | ||
|
||
# Copy common scripts. | ||
COPY /script/* /usr/local/bin/ | ||
|
||
|
@@ -66,8 +79,8 @@ RUN set -x \ | |
# Copy entrypoint script. | ||
COPY /docker-entrypoint.sh / | ||
|
||
# Expose default server port. | ||
EXPOSE $SERVER_PORT/udp | ||
# Set up healthcheck. | ||
HEALTHCHECK --start-period=15m --interval=5m --timeout=1m --retries=3 CMD dst-server version --check | ||
|
||
# Set up a volume for configuration files. | ||
VOLUME ["$CLUSTER_PATH"] | ||
|
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,18 +1,18 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [ `whoami` != "$STEAM_USER" ]; then | ||
exec gosu $STEAM_USER $0 "$@" | ||
if [[ "$(whoami)" != "$STEAM_USER" ]]; then | ||
exec gosu "$STEAM_USER" "$0" "$@" | ||
fi | ||
|
||
# We must have at least one writer | ||
sleep infinity > $DSTA_HOME/console & | ||
sleep infinity > "$DSTA_HOME/console" & | ||
|
||
cd $DST_HOME/bin | ||
cd "$DST_HOME/bin" | ||
|
||
exec ./dontstarve_dedicated_server_nullrenderer \ | ||
-persistent_storage_root `dirname $CLUSTER_PATH` \ | ||
-persistent_storage_root "$(dirname "$CLUSTER_PATH")" \ | ||
-conf_dir "." \ | ||
-cluster `basename $CLUSTER_PATH` \ | ||
-cluster "$(basename "$CLUSTER_PATH")" \ | ||
-shard "$SHARD_NAME" \ | ||
-backup_log_count "$BACKUP_LOG_COUNT" \ | ||
"$@" < <({ stdbuf -oL cat $DSTA_HOME/console & stdbuf -oL cat & }) | ||
"$@" < <({ stdbuf -oL cat "$DSTA_HOME/console" & stdbuf -oL cat & }) |
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,20 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
usage(){ | ||
cat $DSTA_HOME/doc/console.usage | ||
usage() { | ||
cat "$DSTA_HOME/doc/console.usage" | ||
} | ||
|
||
if [ "$1" == "--help" ]; then | ||
if [[ "$1" = "--help" ]]; then | ||
usage | ||
exit 0 | ||
elif [ $# -eq 0 ]; then | ||
cat < /proc/self/fd/0 > $DSTA_HOME/console | ||
elif [[ $# -eq 0 ]]; then | ||
cat < /proc/self/fd/0 > "$DSTA_HOME/console" | ||
else | ||
for command in "$@"; do | ||
if [ "$command" == "-" ]; then | ||
cat < /proc/self/fd/0 > $DSTA_HOME/console | ||
if [[ "$command" = "-" ]]; then | ||
cat < /proc/self/fd/0 > "$DSTA_HOME/console" | ||
else | ||
echo $command > $DSTA_HOME/console | ||
echo "$command" > "$DSTA_HOME/console" | ||
fi | ||
done | ||
fi |
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,48 +1,58 @@ | ||
#!/usr/bin/env bash | ||
|
||
usage(){ | ||
cat $DSTA_HOME/doc/start.usage | ||
usage() { | ||
cat "$DSTA_HOME/doc/start.usage" | ||
} | ||
|
||
if [ $# -eq 0 ]; then | ||
update=0 | ||
elif [ $1 == "--help" ]; then | ||
update=0 | ||
|
||
if [[ $# -eq 0 ]]; then | ||
true # no-op | ||
elif [[ "$1" = "--help" ]]; then | ||
usage | ||
exit 0 | ||
elif [ $# -eq 1 ]; then | ||
case $1 in | ||
--update=all) | ||
update=3 | ||
;; | ||
--update=none) | ||
update=0 | ||
;; | ||
--update=game) | ||
update=1 | ||
;; | ||
--update=mods) | ||
update=2 | ||
;; | ||
esac | ||
fi | ||
|
||
if [ -z "$update" ]; then | ||
usage 1>&2 | ||
exit 1 | ||
else | ||
while [[ "$#" -gt 0 ]] | ||
do | ||
key="$1" | ||
case "$key" in | ||
--update=all) | ||
update=3 | ||
;; | ||
--update=none) | ||
update=0 | ||
;; | ||
--update=game) | ||
update=1 | ||
;; | ||
--update=mods) | ||
update=2 | ||
;; | ||
--keep-configuration=*) | ||
keep="${key#*=}" | ||
keep="${keep//,/ }" | ||
;; | ||
*) | ||
usage 1>&2 | ||
exit 1 | ||
;; | ||
esac | ||
shift | ||
done | ||
fi | ||
|
||
if (((update & 1) != 0)); then | ||
$DSTA_HOME/dst/update.sh | ||
"$DSTA_HOME/dst/update.sh" | ||
fi | ||
|
||
if (((update & 2) == 0)); then | ||
flag="-skip_update_server_mods" | ||
fi | ||
|
||
$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 | ||
"$DSTA_HOME"/boot/token.sh "$keep" | ||
"$DSTA_HOME"/boot/settings.sh "$keep" | ||
"$DSTA_HOME"/boot/lists.sh "$keep" | ||
"$DSTA_HOME"/boot/world.sh "$keep" | ||
"$DSTA_HOME"/boot/mods.sh "$keep" | ||
|
||
exec dontstarve_dedicated_server_nullrenderer $flag | ||
exec dontstarve_dedicated_server_nullrenderer "$flag" |
Oops, something went wrong.