~ fixed script/permission error, volume/server had root permissions
This commit is contained in:
parent
fade62dd33
commit
73ece63e9a
@ -21,8 +21,6 @@ ENV STEAM_PATH="/home/steam" \
|
|||||||
\
|
\
|
||||||
USE_MY_REPLACER_CONFIG=false
|
USE_MY_REPLACER_CONFIG=false
|
||||||
|
|
||||||
VOLUME "$SERVER_PATH"
|
|
||||||
|
|
||||||
ENTRYPOINT ["./home/entrypoint.sh"]
|
ENTRYPOINT ["./home/entrypoint.sh"]
|
||||||
|
|
||||||
COPY ["entrypoint.sh", "installAndMountAddons.sh", "forceWorkshopDownload.sh", "experimental.sh", "/home/"]
|
COPY ["entrypoint.sh", "installAndMountAddons.sh", "forceWorkshopDownload.sh", "experimental.sh", "/home/"]
|
||||||
@ -34,10 +32,14 @@ RUN dpkg --add-architecture i386 && \
|
|||||||
groupadd -g $GROUP_ID $DOCKER_USER && \
|
groupadd -g $GROUP_ID $DOCKER_USER && \
|
||||||
useradd -d /home/steam/ -g $GROUP_ID -u $USER_ID -m $DOCKER_USER && \
|
useradd -d /home/steam/ -g $GROUP_ID -u $USER_ID -m $DOCKER_USER && \
|
||||||
chown "$DOCKER_USER:$DOCKER_USER" /home/entrypoint.sh && \
|
chown "$DOCKER_USER:$DOCKER_USER" /home/entrypoint.sh && \
|
||||||
|
mkdir -p "$SERVER_PATH" && \
|
||||||
|
chown -R "$DOCKER_USER:$DOCKER_USER" "$STEAM_PATH" && \
|
||||||
chmod a=rx /home/entrypoint.sh && \
|
chmod a=rx /home/entrypoint.sh && \
|
||||||
chmod a=rx /home/installAndMountAddons.sh && \
|
chmod a=rx /home/installAndMountAddons.sh && \
|
||||||
chmod a=rx /home/forceWorkshopDownload.sh && \
|
chmod a=rx /home/forceWorkshopDownload.sh && \
|
||||||
chmod a=rx /home/experimental.sh && \
|
chmod a=rx /home/experimental.sh && \
|
||||||
ulimit -n 2048
|
ulimit -n 2048
|
||||||
|
|
||||||
USER "$USER_ID:$GROUP_ID"
|
USER "$USER_ID:$GROUP_ID"
|
||||||
|
|
||||||
|
VOLUME "$SERVER_PATH"
|
@ -1,4 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
echo "starting entrypoint.sh"
|
echo "starting entrypoint.sh"
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
@ -7,7 +8,7 @@ if [ "$1" = "testing" ]; then
|
|||||||
DEBUG_MODE=true
|
DEBUG_MODE=true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "installing / updating steamcmd"
|
echo "installing / updating steamcmd in $STEAM_PATH"
|
||||||
cd "$STEAM_PATH"
|
cd "$STEAM_PATH"
|
||||||
wget -q -O - "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar -zxvf -
|
wget -q -O - "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar -zxvf -
|
||||||
|
|
||||||
@ -21,6 +22,7 @@ if [ -e "${STEAM_PATH}/server/garrysmod/cache" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "testing steamcmd"
|
echo "testing steamcmd"
|
||||||
|
chmod ug=rwx,o= steamcmd.sh
|
||||||
./steamcmd.sh +login anonymous +quit
|
./steamcmd.sh +login anonymous +quit
|
||||||
|
|
||||||
echo "installing / validating ttt"
|
echo "installing / validating ttt"
|
||||||
@ -35,11 +37,16 @@ cd "$STEAM_PATH"
|
|||||||
echo '[error][2] <= printed' && \
|
echo '[error][2] <= printed' && \
|
||||||
./steamcmd.sh +login anonymous +force_install_dir "$STEAM_PATH/server/" +app_update 4020 validate +quit)
|
./steamcmd.sh +login anonymous +force_install_dir "$STEAM_PATH/server/" +app_update 4020 validate +quit)
|
||||||
|
|
||||||
bash experimental.sh
|
|
||||||
bash installAndMountAddons.sh
|
|
||||||
bash forceWorkshopDownload.sh
|
|
||||||
|
|
||||||
echo "processing scripts before start"
|
echo "processing scripts before start"
|
||||||
|
|
||||||
|
echo "experimental.sh"
|
||||||
|
bash /home/experimental.sh
|
||||||
|
echo "forceWorkshopDownload.sh"
|
||||||
|
bash /home/forceWorkshopDownload.sh
|
||||||
|
echo "installAndMountAddons.sh"
|
||||||
|
bash /home/installAndMountAddons.sh
|
||||||
|
|
||||||
|
|
||||||
if [ -e "$SERVER_PATH/custom.sh" ]; then
|
if [ -e "$SERVER_PATH/custom.sh" ]; then
|
||||||
echo "existing: $SERVER_PATH/custom.sh"
|
echo "existing: $SERVER_PATH/custom.sh"
|
||||||
bash "$SERVER_PATH/custom.sh"
|
bash "$SERVER_PATH/custom.sh"
|
||||||
@ -52,6 +59,7 @@ cd "$STEAM_PATH/server/"
|
|||||||
trap 'pkill -15 srcds_run' SIGTERM
|
trap 'pkill -15 srcds_run' SIGTERM
|
||||||
|
|
||||||
if [ "$DEBUG_MODE" != "true" ]; then
|
if [ "$DEBUG_MODE" != "true" ]; then
|
||||||
|
chmod ug=rwx,o= srcds_run
|
||||||
./srcds_run -console -game garrysmod +gamemode terrortown "$@" &
|
./srcds_run -console -game garrysmod +gamemode terrortown "$@" &
|
||||||
wait "$!"
|
wait "$!"
|
||||||
else
|
else
|
||||||
|
@ -4,14 +4,14 @@ set -e
|
|||||||
|
|
||||||
#create default server.config
|
#create default server.config
|
||||||
#TODO don't miss to change to master!
|
#TODO don't miss to change to master!
|
||||||
if [ ! -e "{$SERVER_PATH}/garrysmod/cfg/server.cfg" ]; then
|
if [ ! -e "${SERVER_PATH}/garrysmod/cfg/server.cfg" ]; then
|
||||||
mkdir -p "{$SERVER_PATH}/garrysmod/cfg"
|
mkdir -p "${SERVER_PATH}/garrysmod/cfg"
|
||||||
wget -O "{$SERVER_PATH}/garrysmod/cfg/server.cfg" "https://raw.githubusercontent.com/jusito/docker-ttt/develop/server.cfg"
|
wget -O "${SERVER_PATH}/garrysmod/cfg/server.cfg" "https://raw.githubusercontent.com/jusito/docker-ttt/develop/server.cfg"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#this is a simple option for myself, but you can use it too
|
#this is a simple option for myself, but you can use it too
|
||||||
if [ "$USE_MY_REPLACER_CONFIG" = "true" ]; then
|
if [ "$USE_MY_REPLACER_CONFIG" = "true" ]; then
|
||||||
mkdir -p "{$SERVER_PATH}/garrysmod/data/jusito_ttt_entity_replace"
|
mkdir -p "${SERVER_PATH}/garrysmod/data/jusito_ttt_entity_replace"
|
||||||
wget -O "{$SERVER_PATH}/garrysmod/data/jusito_ttt_entity_replace/config.txt" "https://raw.githubusercontent.com/jusito/ttt_entity_replace/master/config.txt.example_fas2"
|
wget -O "${SERVER_PATH}/garrysmod/data/jusito_ttt_entity_replace/config.txt" "https://raw.githubusercontent.com/jusito/ttt_entity_replace/master/config.txt.example_fas2"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -40,9 +40,9 @@ mount=${mount}$'}'
|
|||||||
if [ ! -e "${SERVER_PATH}/garrysmod/cfg" ]; then
|
if [ ! -e "${SERVER_PATH}/garrysmod/cfg" ]; then
|
||||||
mkdir -p "${SERVER_PATH}/garrysmod/cfg"
|
mkdir -p "${SERVER_PATH}/garrysmod/cfg"
|
||||||
fi
|
fi
|
||||||
if [ -e "${SERVER_PATH}/garrysmod/cfg" ]; then
|
if [ -e "${SERVER_PATH}/garrysmod/cfg/mount.cfg" ]; then
|
||||||
rm "${SERVER_PATH}/garrysmod/cfg"
|
rm "${SERVER_PATH}/garrysmod/cfg/mount.cfg"
|
||||||
fi
|
fi
|
||||||
touch "${SERVER_PATH}/garrysmod/cfg"
|
touch "${SERVER_PATH}/garrysmod/cfg/mount.cfg"
|
||||||
echo "$mount" > "${SERVER_PATH}/garrysmod/cfg/mount.cfg"
|
echo "$mount" > "${SERVER_PATH}/garrysmod/cfg/mount.cfg"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user