Fixes and enhancements.
- Fixed potential startup and shutdown issues - Switched to a dedicated version of the server - Added a default configuration to avoid potential IP address binding issues - Added the ability to add unit tests in the futuremaster
parent
8d8747bf02
commit
a3afa73b75
34
Dockerfile
34
Dockerfile
|
@ -1,32 +1,15 @@
|
||||||
FROM ubuntu:16.04
|
FROM didstopia/base:nodejs-steamcmd-ubuntu-16.04
|
||||||
|
|
||||||
MAINTAINER didstopia
|
MAINTAINER Didstopia <support@didstopia.com>
|
||||||
|
|
||||||
# Fixes apt-get warnings
|
# Fixes apt-get warnings
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
# Setup the locales
|
# Install dependencies
|
||||||
RUN apt-get clean && apt-get update && apt-get install -y apt-utils locales && locale-gen en_US.UTF-8
|
RUN apt-get update && \
|
||||||
ENV LANG en_US.UTF-8
|
apt-get install -y --no-install-recommends \
|
||||||
ENV LANGUAGE en_US:en
|
net-tools && \
|
||||||
ENV LC_ALL en_US.UTF-8
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Run a quick apt-get update/upgrade
|
|
||||||
RUN apt-get update && apt-get upgrade -y && apt-get dist-upgrade -y && apt-get autoremove -y
|
|
||||||
|
|
||||||
# Install dependencies, mainly for SteamCMD
|
|
||||||
RUN apt-get install -y \
|
|
||||||
ca-certificates \
|
|
||||||
software-properties-common \
|
|
||||||
python-software-properties \
|
|
||||||
lib32gcc1 \
|
|
||||||
libstdc++6 \
|
|
||||||
curl \
|
|
||||||
wget \
|
|
||||||
libvorbisfile3
|
|
||||||
|
|
||||||
# Run as root
|
|
||||||
USER root
|
|
||||||
|
|
||||||
# Create and set the steamcmd folder as a volume
|
# Create and set the steamcmd folder as a volume
|
||||||
RUN mkdir -p /steamcmd/starbound
|
RUN mkdir -p /steamcmd/starbound
|
||||||
|
@ -38,6 +21,9 @@ ADD install.txt /install.txt
|
||||||
# Copy the startup script
|
# Copy the startup script
|
||||||
ADD start_starbound.sh /start.sh
|
ADD start_starbound.sh /start.sh
|
||||||
|
|
||||||
|
# Copy the default configuration file
|
||||||
|
ADD starbound_server.default.config /starbound_server.default.config
|
||||||
|
|
||||||
# Set the current working directory
|
# Set the current working directory
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,13 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Build changes (if necessary)
|
||||||
./docker_build.sh
|
./docker_build.sh
|
||||||
|
|
||||||
# Run a vanilla server
|
# Run a container
|
||||||
docker run -p 0.0.0.0:21025:21025/tcp --env-file .env -v $(pwd)/starbound_data:/steamcmd/starbound --name starbound-server -d didstopia/starbound-server:latest
|
docker run -p 0.0.0.0:21025:21025/tcp --env-file .env -v "$(pwd)/starbound_data:/steamcmd/starbound" --name starbound-server -it --rm didstopia/starbound-server:latest
|
||||||
|
|
||||||
docker logs -f starbound-server
|
# Edit unit tests
|
||||||
|
#dgoss edit -p 0.0.0.0:21025:21025/tcp --env-file .env -v "$(pwd)/starbound_data:/steamcmd/starbound" --name starbound-server -d didstopia/starbound-server:latest
|
||||||
|
|
||||||
|
# Run unit tests (production)
|
||||||
|
#GOSS_WAIT_OPTS="--retry-timeout 300s --sleep 1s > /dev/null" GOSS_SLEEP="15" dgoss run -p 0.0.0.0:21025:21025/tcp --env-file .env -v "$(pwd)/starbound_data:/steamcmd/starbound" --name starbound-server -d didstopia/starbound-server
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
command:
|
||||||
|
ps -eo comm | tee /tmp/what_do_i_see:
|
||||||
|
title: Starbound Server should be running
|
||||||
|
exit-status: 0
|
||||||
|
stdout:
|
||||||
|
- starbound_serve
|
||||||
|
|
||||||
|
port:
|
||||||
|
tcp:21025:
|
||||||
|
title: Starbound Server should be accepting TCP connections on port 21025
|
||||||
|
listening: true
|
||||||
|
|
||||||
|
## TODO: Test graceful shutdown
|
|
@ -0,0 +1,11 @@
|
||||||
|
command:
|
||||||
|
ps -eo comm | tee /tmp/what_do_i_see:
|
||||||
|
title: Starbound Server should be running
|
||||||
|
exit-status: 0
|
||||||
|
stdout:
|
||||||
|
- starbound_serve
|
||||||
|
|
||||||
|
port:
|
||||||
|
tcp:21025:
|
||||||
|
title: Starbound Server should be accepting TCP connections on port 21025
|
||||||
|
listening: true
|
|
@ -2,5 +2,5 @@
|
||||||
login anonymous
|
login anonymous
|
||||||
force_install_dir /steamcmd/starbound
|
force_install_dir /steamcmd/starbound
|
||||||
app_info_update 1
|
app_info_update 1
|
||||||
app_update 211820 validate
|
app_update 533830 validate
|
||||||
quit
|
quit
|
||||||
|
|
|
@ -0,0 +1,50 @@
|
||||||
|
{
|
||||||
|
"allowAdminCommands" : true,
|
||||||
|
"allowAdminCommandsFromAnyone" : false,
|
||||||
|
"allowAnonymousConnections" : true,
|
||||||
|
"allowAssetsMismatch" : true,
|
||||||
|
"anonymousConnectionsAreAdmin" : false,
|
||||||
|
"bannedIPs" : [],
|
||||||
|
"bannedUuids" : [],
|
||||||
|
"checkAssetsDigest" : false,
|
||||||
|
"clearPlayerFiles" : false,
|
||||||
|
"clearUniverseFiles" : false,
|
||||||
|
"clientIPJoinable" : false,
|
||||||
|
"clientP2PJoinable" : true,
|
||||||
|
"configurationVersion" : {
|
||||||
|
"basic" : 2,
|
||||||
|
"server" : 4
|
||||||
|
},
|
||||||
|
"crafting" : {
|
||||||
|
"filterHaveMaterials" : false
|
||||||
|
},
|
||||||
|
"gameServerBind" : "0.0.0.0",
|
||||||
|
"gameServerPort" : 21025,
|
||||||
|
"interactiveHighlight" : true,
|
||||||
|
"inventory" : {
|
||||||
|
"pickupToActionBar" : true
|
||||||
|
},
|
||||||
|
"maxPlayers" : 8,
|
||||||
|
"maxTeamSize" : 4,
|
||||||
|
"monochromeLighting" : false,
|
||||||
|
"playerBackupFileCount" : 3,
|
||||||
|
"queryServerBind" : "::",
|
||||||
|
"queryServerPort" : 21025,
|
||||||
|
"rconServerBind" : "::",
|
||||||
|
"rconServerPassword" : "",
|
||||||
|
"rconServerPort" : 21026,
|
||||||
|
"rconServerTimeout" : 1000,
|
||||||
|
"runQueryServer" : false,
|
||||||
|
"runRconServer" : false,
|
||||||
|
"safeScripts" : true,
|
||||||
|
"scriptInstructionLimit" : 10000000,
|
||||||
|
"scriptInstructionMeasureInterval" : 10000,
|
||||||
|
"scriptProfilingEnabled" : false,
|
||||||
|
"scriptRecursionLimit" : 100,
|
||||||
|
"serverFidelity" : "automatic",
|
||||||
|
"serverName" : "A Starbound Server",
|
||||||
|
"serverOverrideAssetsDigest" : null,
|
||||||
|
"serverUsers" : {
|
||||||
|
},
|
||||||
|
"tutorialMessages" : true
|
||||||
|
}
|
|
@ -3,8 +3,16 @@
|
||||||
# Define the exit handler
|
# Define the exit handler
|
||||||
exit_handler()
|
exit_handler()
|
||||||
{
|
{
|
||||||
echo "Shutdown signal received"
|
echo ""
|
||||||
|
echo "Waiting for server to shutdown.."
|
||||||
|
echo ""
|
||||||
kill -SIGINT "$child"
|
kill -SIGINT "$child"
|
||||||
|
sleep 5
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "Terminating.."
|
||||||
|
echo ""
|
||||||
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
# Trap specific signals and forward to the exit handler
|
# Trap specific signals and forward to the exit handler
|
||||||
|
@ -17,7 +25,9 @@ if [ ! -d "/steamcmd/starbound/linux" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Install/update steamcmd
|
# Install/update steamcmd
|
||||||
|
echo ""
|
||||||
echo "Installing/updating steamcmd.."
|
echo "Installing/updating steamcmd.."
|
||||||
|
echo ""
|
||||||
curl -s http://media.steampowered.com/installer/steamcmd_linux.tar.gz | tar -v -C /steamcmd -zx
|
curl -s http://media.steampowered.com/installer/steamcmd_linux.tar.gz | tar -v -C /steamcmd -zx
|
||||||
|
|
||||||
# Check that username and password are both set
|
# Check that username and password are both set
|
||||||
|
@ -34,7 +44,9 @@ if [ ! -f "/steamcmd/starbound/linux/starbound_server" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
# Install Starbound from install.txt
|
# Install Starbound from install.txt
|
||||||
echo "Installing/updating Starbound.."
|
echo ""
|
||||||
|
echo "Installing Starbound.."
|
||||||
|
echo ""
|
||||||
bash /steamcmd/steamcmd.sh +runscript /install.txt
|
bash /steamcmd/steamcmd.sh +runscript /install.txt
|
||||||
else
|
else
|
||||||
# Check that username and password are both set, otherwise skip update
|
# Check that username and password are both set, otherwise skip update
|
||||||
|
@ -47,16 +59,29 @@ else
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# Install Starbound from install.txt
|
# Install Starbound from install.txt
|
||||||
echo "Installing Starbound.."
|
echo ""
|
||||||
|
echo "Updating Starbound.."
|
||||||
|
echo ""
|
||||||
bash /steamcmd/steamcmd.sh +runscript /install.txt
|
bash /steamcmd/steamcmd.sh +runscript /install.txt
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set the working directory
|
# Set the working directory
|
||||||
cd /steamcmd/starbound/linux
|
cd /steamcmd/starbound/linux || exit
|
||||||
|
|
||||||
|
# Copy default configuration if necessary
|
||||||
|
if [ ! -f "/steamcmd/starbound/storage/starbound_server.config" ]; then
|
||||||
|
echo ""
|
||||||
|
echo "Copying default configuration.."
|
||||||
|
echo ""
|
||||||
|
mkdir -p /steamcmd/starbound/storage
|
||||||
|
cp -f /starbound_server.default.config /steamcmd/starbound/storage/starbound_server.config
|
||||||
|
fi
|
||||||
|
|
||||||
# Run the server
|
# Run the server
|
||||||
|
echo ""
|
||||||
echo "Starting Starbound.."
|
echo "Starting Starbound.."
|
||||||
|
echo ""
|
||||||
./starbound_server 2>&1 &
|
./starbound_server 2>&1 &
|
||||||
|
|
||||||
child=$!
|
child=$!
|
||||||
|
|
Loading…
Reference in New Issue