This repository holds all Dockerfiles and bash scripts to build the TeaSpeak Server Images as well as the Web-Client Image
Basic instructions to build and run the TeaSpeak server images yourself.
# Build the Image with the latest server
docker build -f server/alpine.Dockerfile -t teaspeak/server:latest-alpine ./server
# alternatively with server version <x.y.z>
# docker build -f server/alpine.Dockerfile --build-arg SERVER_VERSION=<x.y.z> -t teaspeak/server:<x.y.z>-alpine ./server
# run the Alpine based server image
docker run -d \
-v teaspeak_logs:/ts/logs \
-v teaspeak_db:/ts/database \
-v teaspeak_files:/ts/files \
-v teaspeak_certs:/ts/certs \
-v teaspeak_config:/ts/config \
-v teaspeak_crash_dumps:/ts/crash_dumps \
-p 9987:9987/tcp -p 9987:9987/udp -p 10101:10101/tcp -p 30303:30303/tcp \
--restart=unless-stopped --name teaspeak-server teaspeak/server:latest-alpine
Build and Run Debian
# Build the Image with the latest server
docker build -f server/debian.Dockerfile -t teaspeak/server:latest-debian ./server
# alternatively with server version <x.y.z>
# docker build -f server/debian.Dockerfile --build-arg SERVER_VERSION=<x.y.z> -t teaspeak/server:<x.y.z>-debian ./server
# run the Debian based server image
docker run -d \
-v teaspeak_logs:/ts/logs \
-v teaspeak_db:/ts/database \
-v teaspeak_files:/ts/files \
-v teaspeak_certs:/ts/certs \
-v teaspeak_config:/ts/config \
-v teaspeak_crash_dumps:/ts/crash_dumps \
-p 9987:9987/tcp -p 9987:9987/udp -p 10101:10101/tcp -p 30303:30303/tcp \
--restart=unless-stopped --name teaspeak-server teaspeak/server:latest-debian
Build and Run Debian
# Build the Image with the latest server
docker build -f server/ubuntu.Dockerfile -t teaspeak/server:latest-ubuntu ./server
# alternatively with server version <x.y.z>
# docker build -f server/ubuntu.Dockerfile --build-arg SERVER_VERSION=<x.y.z> -t teaspeak/server:<x.y.z>-ubuntu ./server
# run the Ubuntu based server image
docker run -d \
-v teaspeak_logs:/ts/logs \
-v teaspeak_db:/ts/database \
-v teaspeak_files:/ts/files \
-v teaspeak_certs:/ts/certs \
-v teaspeak_config:/ts/config \
-v teaspeak_crash_dumps:/ts/crash_dumps \
-p 9987:9987/tcp -p 9987:9987/udp -p 10101:10101/tcp -p 30303:30303/tcp \
--restart=unless-stopped --name teaspeak-server teaspeak/server:latest-ubuntu
Variable | Default | Description |
---|---|---|
TZ | Europe/Berlin |
Sets the timezone within the container. |
The TZ
variable works everywhere EXCEPT in the alpine
based server image, where the log times are UTC.
This seems to be a bug with the glib based Alpine Linux image.
(their Wiki explicitly states that glibc based installs define their timezones differently, yet fail to mention how to set it in that case 😕 😒)
Build-Arg | Default | Description |
---|---|---|
SERVER_VERSION | blank | This build argument sets the server version to be installed in the resulting image. If its left blank the latest released server verison will be installed. |
uid | 4242 |
The default user id of the teaspeak user used in the container |
gid | 4242 |
The default group id of the teaspeak user used in the container |
docker-compose.yml
version: '3.7'
services:
teaspeak-server:
image: teaspeak/server:latest
environment:
- TZ=Europe/Amsterdam
ports:
- "9987:9987/udp"
- "9987:9987/tcp"
- "10101:10101/tcp"
- "30303:30303/tcp"
volumes:
- type: volume
source: teaspeak_certs
target: /ts/certs
- type: volume
source: teaspeak_config
target: /ts/config
- type: volume
source: teaspeak_db
target: /ts/database
- type: volume
source: teaspeak_files
target: /ts/files
- type: volume
source: teaspeak_logs
target: /ts/logs
- type: volume
source: teaspeak_crash_dumps
target: /ts/crash_dumps
restart: unless-stopped
volumes:
teaspeak_certs:
teaspeak_crash_dumps:
teaspeak_config:
teaspeak_db:
teaspeak_files:
teaspeak_logs:
To run this please ensure you have docker-compose installed.
docker-compose up -d
To view the docker container logs and to find the server token you have to run the following command:
docker logs <container-name|container-id>
# to get the container name or id run the following
docker ps
# eg. if the server gets started as displayed in the above section
docker logs teaspeak-server
# and if you want to follow the logs (ctrl+c to stop following)
docker logs -f teaspeak-server
Important note: There are several ways to store data used by applications that run in Docker containers.
We encourage users of the teaspeak
images to familiarize themselves with the options available, including:
- Let Docker manage the storage of your database data by writing the database files to disk on the host system using its own internal volume management. This is the default and is easy and fairly transparent to the user. The downside is that the files may be hard to locate for tools and applications that run directly on the host system, i.e. outside containers.
- Create a data directory on the host system (outside the container) and mount this to a directory visible from inside the container. This places the database files in a known location on the host system, and makes it easy for tools and applications on the host system to access the files. The downside is that the user needs to make sure that the directory exists, and that e.g. directory permissions and other security mechanisms on the host system are set up correctly.
The Docker documentation is a good starting point for understanding the different storage options and variations, and there are multiple blogs and forum postings that discuss and give advice in this area.
Basic instructions to build and host the TeaWeb client images yourself.
This image is based on the official Nginx Docker image (Alpine Linux flavour)
# Build the image with the latest web release
docker build -f web/Dockerfile -t teaspeak/web:latest ./web
# alternatively with a specific web version <gitHash>
# docker build -f web/Dockerfile --build-arg WEB_VERSION=<gitHash> -t teaspeak/web:<gitHash> ./web
# run the Ubuntu based server image
docker run -d \
-p 80:80 -p 443:443 \
-v $(pwd)/certs:/etc/ssl/certs \
--restart=on-failure:3 --name teaspeak-web teaspeak/web:latest
This image will auto-generate a self-signed certificate at initial boot-up, unless the user provides one during from the get-go. This happens because an https connection is required by the web client to function. Should the user decide to provide their own certificates at initial boot or later, then the following aspects have to be kept in mind:
- the certificate and key have to have a name in these formats:
- the crt file:
tea_bundle.crt
- the key file:
tea.key
- the crt file:
- optionally the user can also provide a Diffie–Hellman parameter,
otherwise the file will also be generated at initial boot
- the Diffie–Hellman param:
dhparam.pem
- the Diffie–Hellman param:
All auto-generated files will be persisted in the /etc/ssl/certs
folder within the container.
This folder, if not mounted by the user, will be force mounted into an anonym volume on the host machine.
By using the above docker run
command, or the provided docker-compose
script for the web client a bind-mounted
folder shall be used to store the .crt
, .key
and .pem
files.
Variable | Default | Description |
---|---|---|
TZ | Europe/Berlin |
Sets the timezone within the container. |
Build-Arg | Default | Description |
---|---|---|
WEB_VERSION | blank | This build argument sets the web client version to be installed in the resulting image. If its left blank the latest released client version will be installed |
docker-compose.yml
version: '3.7'
services:
teaspeak-web:
image: teaspeak/web:latest
environment:
- TZ=Europe/Amsterdam
ports:
- "80:80"
- "443:443"
volumes:
- type: bind
source: ./certs
target: /etc/ssl/certs
restart: on-failure:3
To run this please ensure you have docker-compose installed.
docker-compose up -d
If you never updated a container bases application before you can follow these simplified workflows:
- Notify the user base of the application about an upcoming update maintenance (best to specify a specific date/time and choose a relatively quiet timeslot)
- Before the maintenance starts download the image version you want to update to,
for this example we assume an upgrade from previous
latest
to newlatest
, by issuing adocker pull teaspeak/[server|web]:latest
command. (NOTE: this will clone the new version of the image locally, so it can be used once you restart to update) - Give one last heads up to the users that may be still using the application and then run
docker stop teaspeak-[server|web]
to shut down the application, after that rundocker rm teaspeak-[server|web]
to remove the old version container. - As soon as the commands of step
3.
return successfully you can restart the application with the new image versions by running the corresponding run commands found in the Server or Web sections.
- Notify the user base of the application about an upcoming update maintenance (best to specify a specific date/time and choose a relatively quiet timeslot)
- If you are using a specific
tag
for the app images in your composeyaml
files change it to the tag you want to update to. Then usedocker-compose pull
to pull the latest version of your desired image specified in thedocker-compose.yml
. (NOTE: this will clone the new version of the image locally, so it can be used once you restart to update) - Give one last heads up to the users that may be still using the application and then issue the following two commands:
docker-compose down
anddocker-compose up -d
- As soon as the commands of step
3.
return successfully you can start reconnecting to the applications.
To clean up old unused images you can either delete them manually by
- first listing them with
docker images
, finding the no longer used images and the runningdocker rmi <image-name...>
- or by running
docker image prune
, yet be careful with this command, as it will delete ALL images not used by any container and could yield unwanted results therefor
Note: The list below is not sorted by any priority, nor are there concrete plans to realize the listed ideas. The following should not be misunderstood as planned features, but more ideas remaining from the image rework.
- use single volume mount point to decrease CLI clutter (requires the server to handle symlinks better)
- allow the user to change the cert- and key-file name via env
- allow the user to use let's encrypt to provide certificates (REQUIRES user to have a valid TLD)
Have an idea not listed here? Open an issue and we shall discuss!