new setup

This commit is contained in:
2022-06-16 13:53:53 -07:00
parent 12db2b2f07
commit 91e47a4e29
9 changed files with 369 additions and 0 deletions

14
alpine/CHANGELOG Normal file
View File

@@ -0,0 +1,14 @@
Changes:
2019-1-2
Changed the update process to preserve all settings/files/logs created by user/server.
2019-1-3
Added an automatic check for new teamspeak server verstion on startup.
added more information output to indicate what is happening.
2019-1-5
changed the way user files are preserved during update process now it is much faster.

21
alpine/Dockerfile Normal file
View File

@@ -0,0 +1,21 @@
FROM alpine:latest
# URL's for files
ARG INSTALL_SCRIPT=https://raw.githubusercontent.com/fithwum/teamspeak-server/master/alpine/files/Install_Script.sh
# Install dependencies and folder creation
RUN apk update && apk add --no-cache ca-certificates libstdc++ su-exec bash-completion tar \
&& mkdir -p /ts3server /ts3temp /ts3temp/inifiles /ts3temp/serverfiles \
&& chmod 777 -R /ts3server /ts3temp \
&& chown 99:100 -R /ts3server /ts3temp
ADD "${INSTALL_SCRIPT}" /ts3temp
RUN chmod +x /ts3temp/Install_Script.sh
# directory where data is stored
VOLUME /ts3server
# 9987 default voice, 10011 server query, 30033 file transport
EXPOSE 9987/udp 10011/tcp 30033/tcp
# Run command
CMD [ "/bin/sh", "/ts3temp/Install_Script.sh" ]

View File

@@ -0,0 +1,85 @@
#!/bin/bash
# Copyright (c) 2018 fithwum
# All rights reserved
# Variables.
echo " "
echo "Checking for new server version from Teamspeak."
wget --no-cache https://www.teamspeak.com/versions/server.json -O /ts3temp/server.json
TS_VERSION_CHECK=$(cat /ts3temp/server.json | grep version | head -1 | awk -F: '{print $4}' | sed 's/[",]//g' | sed "s/checksum//g")
TS_VERSION=${TS_VERSION_CHECK}
CHANGELOG=/ts3server/CHANGELOG_${TS_VERSION}
echo "Latest server version from Teamspeak:$TS_VERSION"
# Main install (alpine).
# Check for files in /ts3server and download/create if needed.
if [ -e "${CHANGELOG}" ]
then
echo "INFO ! Teamspeak server is ${TS_VERSION} ... checking that needed files exist before running current server."
rm -fr /ts3temp/server.json
else
echo " "
echo "WARNING ! Teamspeak server is out of date ... will download the updated server from teamspeak."
echo " "
echo "INFO ! Cleaning outdated Teamspeak server files and downloading server update."
rm -f /ts3server/CHANGELOG* /ts3server/lib* /ts3server/ts3server
rm -fr /ts3server/doc /ts3server/redist /ts3server/serverquerydocs /ts3server/tsdns
wget --no-cache https://files.teamspeak-services.com/releases/server/${TS_VERSION}/teamspeak3-server_linux_alpine-${TS_VERSION}.tar.bz2 -O /ts3temp/ts3server_${TS_VERSION}.tar.bz2
tar -xf /ts3temp/ts3server_${TS_VERSION}.tar.bz2 -C /ts3temp/serverfiles --strip-components=1
sleep 1
rm -fr /ts3temp/serverfiles/ts3server_startscript.sh
rm -fr /ts3temp/ts3server_${TS_VERSION}.tar.bz2
cp -uR /ts3temp/serverfiles/. /ts3server/
sleep 1
mv /ts3server/redist/libmariadb.so.2 /ts3server/libmariadb.so.2
mv /ts3server/CHANGELOG ${CHANGELOG}
rm -fr /ts3temp/serverfiles/*
rm -fr /ts3temp/server.json
fi
# Check if the ini/sh files exist in /ts3server and download/create if needed.
if [ -e /ts3server/ts3server_minimal_runscript.sh ]
then
echo "INFO ! ts3server_minimal_runscript.sh found ... will not download."
else
echo " "
echo "WARNING ! ts3server_minimal_runscript.sh not found ... will download now."
wget --no-cache https://raw.githubusercontent.com/fithwum/files-for-dockers/master/scripts/ts3server_minimal_runscript.sh -O /ts3temp/inifiles/ts3server_minimal_runscript.sh
cp /ts3temp/inifiles/ts3server_minimal_runscript.sh /ts3server/
rm -fr /ts3temp/ts3server_minimal_runscript.sh
fi
if [ -e /ts3server/ts3db_mariadb.ini ]
then
echo "INFO ! ts3db_mariadb.ini found ... will not download."
else
echo " "
echo "WARNING ! ts3db_mariadb.ini not found ... will download now."
wget --no-cache https://raw.githubusercontent.com/fithwum/files-for-dockers/master/files/ts3db_mariadb.ini -O /ts3temp/inifiles/ts3db_mariadb.ini
cp /ts3temp/inifiles/ts3db_mariadb.ini /ts3server/
rm -fr /ts3temp/inifiles/ts3db_mariadb.ini
fi
if [ -e /ts3server/ts3server.ini ]
then
echo "INFO ! ts3server.ini found ... will not download."
else
echo " "
echo "WARNING ! ts3server.ini not found ... will download now."
wget --no-cache https://raw.githubusercontent.com/fithwum/files-for-dockers/master/files/ts3server.ini -O /ts3temp/inifiles/ts3server.ini
cp /ts3temp/inifiles/ts3server.ini /ts3server/
rm -fr /ts3temp/inifiles/ts3server.ini
fi
sleep 1
# Set permissions.
chown 99:100 -R /ts3server
chmod 776 -R /ts3server
chmod +x /ts3server/ts3server_minimal_runscript.sh
chmod +x /ts3server/ts3server
# Run.
echo " "
echo "INFO ! Starting Teanspeak server ${TS_VERSION}"
exec /ts3server/ts3server_minimal_runscript.sh inifile=ts3server.ini
exit