├── Dockerfile └── README.md /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | 3 | ENV TEAMSPEAK_URL https://files.teamspeak-services.com/releases/server/3.13.3/teamspeak3-server_linux_amd64-3.13.3.tar.bz2 4 | ENV TS3_UID 1000 5 | 6 | # IMPORTANT! Override TS3SERVER_LICENSE with "accept" to use the Teamspeak 3 server! You can print it with "view" to read 7 | 8 | ENV LANG C.UTF-8 9 | ENV LC_ALL C.UTF-8 10 | 11 | RUN apt-get update -q \ 12 | && DEBIAN_FRONTEND=noninteractive apt-get install -qy bzip2 wget \ 13 | && apt-get clean \ 14 | && rm -rf /var/lib/apt \ 15 | && useradd -u ${TS3_UID} ts3 \ 16 | && mkdir -p /home/ts3 \ 17 | && wget -q -O /home/ts3/teamspeak3-server_linux_amd64.tar.bz2 ${TEAMSPEAK_URL} \ 18 | && tar --directory /home/ts3 -xjf /home/ts3/teamspeak3-server_linux_amd64.tar.bz2 \ 19 | && rm /home/ts3/teamspeak3-server_linux_amd64.tar.bz2 \ 20 | && mkdir -p /home/ts3/data/logs \ 21 | && mkdir -p /home/ts3/data/files \ 22 | # && ln -s /home/ts3/data/files /home/ts3/teamspeak3-server_linux_amd64 \ 23 | && ln -s /home/ts3/data/ts3server.sqlitedb /home/ts3/teamspeak3-server_linux_amd64/ts3server.sqlitedb \ 24 | && chown -R ts3 /home/ts3 25 | # Symlink because i dont know how to move sqlite-db (like dbpath=/data/ts/mysqlite.db) 26 | 27 | USER ts3 28 | ENTRYPOINT ["/home/ts3/teamspeak3-server_linux_amd64/ts3server_minimal_runscript.sh"] 29 | CMD ["inifile=/home/ts3/data/ts3server.ini", "logpath=/home/ts3/data/logs","licensepath=/home/ts3/data/","query_ip_whitelist=/home/ts3/data/query_ip_whitelist.txt","query_ip_backlist=/home/ts3/data/query_ip_blacklist.txt"] 30 | 31 | VOLUME ["/home/ts3/data"] 32 | 33 | # Expose the Standard TS3 port, for files, for serverquery 34 | EXPOSE 9987/udp 30033 10011 35 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## docker-teamspeak3 2 | 3 | Ubuntu with TS3 Server. 4 | 5 | [![](https://images.microbadger.com/badges/image/devalx/docker-teamspeak3.svg)](https://microbadger.com/images/devalx/docker-teamspeak3 "Get your own image badge on microbadger.com") 6 | 7 | ### IMPORTANT env-variable TS3SERVER_LICENSE 8 | Since a recent Temspeak Version its necessary to override the env-variable **TS3SERVER_LICENSE with "accept"**, otherwise the server will just print an info about the licence not being accepted and **WILL NOT START**. 9 | The licence can be printed with "view", see following examples how to do it and make sure you read the licence and make an explicit decision to accept it. 10 | 11 | ### Example docker-compose.yml as of 09.08.2018 12 | 13 | First create volume to keep it after updates: 14 | ``` 15 | docker volume create ts3-data 16 | ``` 17 | 18 | ``` 19 | version: "3.7" 20 | services: 21 | server: 22 | image: devalx/docker-teamspeak3:latest 23 | environment: 24 | - TS3SERVER_LICENSE=accept 25 | ports: 26 | - 9987:9987/udp 27 | - 10011:10011 28 | - 30033:30033 29 | volumes: 30 | - ts3-data:/home/ts3/data 31 | volumes: 32 | ts3-data: 33 | external: true 34 | ``` 35 | 36 | ### Summary 37 | * Ubuntu + Teamspeak 3 Server 38 | * Some files can be injected to host: 39 | * query_ip_whitelist.txt 40 | * query_ip_blacklist.txt 41 | * logs 42 | * files (Not yet) 43 | * ts3server.sqlitedb 44 | * licence (Maybe; Dont have one) 45 | * ts3server.ini (Not tested) 46 | 47 | ### Update Notice 48 | I made bigger updates to the Dockerfile to simplify and streamline the whole process. Please read the following infos carefully! 49 | The old image used root to run the ts3-server and there all created files had root-permission. The new image uses a dedicated user (ts3) with a default UID of 1000 which can be overridden with an ENV-variable (TS3_UID). So in case you want to use old data you most probably need to chown the old files to the new user/uid. 50 | Also the volumes inside the container have changed, the strcture itself should be the same - so the docker run command will differ slightly from the old version. 51 | 52 | #### docker volume create (Since docker-engine 1.9 - RECOMMENDED) 53 | ``` 54 | docker volume create --name ts3-data 55 | docker run --name=ts3 -p 9987:9987/udp -p 30033:30033 -p 10011:10011 -v ts3-data:/home/ts3/data devalx/docker-teamspeak3:latest 56 | ``` 57 | 58 | #### Mounted Host-directory 59 | ``` 60 | docker run --name ts3 -d -p 9987:9987/udp -p 30033:30033 -p 10011:10011 -v {FOLDER}:/home/ts3/data devalx/docker-teamspeak3:latest 61 | ``` 62 | 63 | If you experience permission problems, especially after an upgrade, you can use the TS3_UID-env to set the user for the teamspeak-server process (inside the container). When using an mounted host-directory, the owner of the files will be the UID of this internal user (default is 1000) 64 | 65 | ``` 66 | docker run --name ts3 -d -p -e TS3_UID=1001 9987:9987/udp -p 30033:30033 -p 10011:10011 -v {FOLDER}:/home/ts3/data devalx/docker-teamspeak3:latest 67 | ``` 68 | This would change the internal user to an UID of 1001. 69 | 70 | 71 | #### MariaDB 72 | 73 | This is still WIP. 74 | 75 | ### Admin Secret 76 | After starting the container you probably want to get the Admin secret with: 77 | `sudo docker logs ts3` 78 | 79 | ### Upgrading 80 | Just stop and remove the old container, then start again at "Creating container". You may have to pull the image again if its not updating. 81 | CAUTION: Didnt test if all files are really persisted or if the TS3 process overwrites some files. So make sure you have a backup. 82 | 83 | ### SELinux 84 | If your host uses SELinux it may be necessary to use the **:z** option: 85 | ``` 86 | docker run --name ts3 -d -p 9987:9987/udp -p 30033:30033 -p 10011:10011 -v /data/teamspeak:/home/ts3/data:z devalx/docker-teamspeak3:latest 87 | ``` 88 | Also see issue [#6](../../issues/6) 89 | --------------------------------------------------------------------------------