Skip to content

Commit

Permalink
Push new version
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlgo11 committed Sep 23, 2021
1 parent b70e88d commit 3bc0fc0
Show file tree
Hide file tree
Showing 12 changed files with 714 additions and 503 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ jobs:
push: true
tags: |
carlgo11/teamspeak:latest
ghcr.io/carlgo11/teamspeak-docker:latest
ghcr.io/carlgo11/teamspeak:latest
12 changes: 0 additions & 12 deletions .github/workflows/docker.yml

This file was deleted.

6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
./.idea
./ts3db_mariadb.ini
./ts3server_config.ini
./docker-compose.yml
./docker-compose.yml
.idea
10 changes: 3 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
FROM alpine
WORKDIR /teamspeak
RUN apk --force-refresh --no-cache --purge -f -u add curl jq wget libstdc++
RUN apk --force-refresh --no-cache --purge -f -u add curl jq libstdc++
RUN adduser -u 1000 -S teamspeak teamspeak
COPY entrypoint.sh entrypoint.sh
RUN chown 1000 /teamspeak -R; chmod 700 /teamspeak -R; chmod 500 entrypoint.sh
RUN mkdir /teamspeak/files
RUN chown 1000 /teamspeak/files -R
COPY --chown=1000:1000 entrypoint.sh entrypoint.sh
USER 1000
ENTRYPOINT [ "sh", "-c", "./entrypoint.sh; ./ts3server license_accepted=1 inifile=ts3server.ini" ]
ENTRYPOINT [ "sh", "-c", "/entrypoint.sh; cd /teamspeak; ./ts3server license_accepted=1 inifile=ts3server.ini" ]
1,069 changes: 674 additions & 395 deletions LICENSE

Large diffs are not rendered by default.

32 changes: 9 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![License](https://img.shields.io/github/license/Carlgo11/Teamspeak-docker?color=00b1d6&style=for-the-badge)][license]
[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/Carlgo11/Teamspeak-docker?style=for-the-badge)][version]
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/Carlgo11/Teamspeak-docker/Docker?style=for-the-badge)][workflow]
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/carlgo11/teamspeak-docker/Publish%20Image?style=for-the-badge)][workflow]
[![Docker](https://img.shields.io/docker/image-size/carlgo11/teamspeak?label=Docker&sort=semver&style=for-the-badge)][docker]

This package is a minimal version of TeamSpeak3 as a Docker container.
Expand All @@ -16,27 +16,14 @@ To use this project you'll need:

## Installation

### MariaDB (MySQL)

1. Download the files in [examples/mariadb][mariadb].
```sh
wget https://raw.githubusercontent.com/Carlgo11/Teamspeak-docker/master/examples/mariadb/docker-compose.yml
wget https://raw.githubusercontent.com/Carlgo11/Teamspeak-docker/master/examples/mariadb/ts3server_config.ini
```
1. Enter the database credentials in `docker-compose.yml`.
1. Start the docker containers (append `-d` to run in the background.)
1. Download the files in [examples][examples]
```sh
docker-compose up -d
```

### SQLite

1. Download the files in [examples/sqlite][sqlite].
```shell
wget https://raw.githubusercontent.com/Carlgo11/Teamspeak-docker/master/examples/sqlite/docker-compose.yml
wget https://raw.githubusercontent.com/Carlgo11/Teamspeak-docker/master/examples/sqlite/ts3server_config.ini
wget https://raw.githubusercontent.com/Carlgo11/Teamspeak-docker/master/examples/docker-compose.yml
wget https://raw.githubusercontent.com/Carlgo11/Teamspeak-docker/master/examples/ts3server_config.ini
wget https://raw.githubusercontent.com/Carlgo11/Teamspeak-docker/master/examples/.env
```
1. Start the docker containers (append `-d` to run in the background.)
1. Change the database credentials in `.env`
1. Start the docker containers
```sh
docker-compose up -d
```
Expand All @@ -53,8 +40,7 @@ This work is licensed under [CC BY 4.0][cc]. See the full license [here][license
[license]: LICENSE
[cc]: https://creativecommons.org/licenses/by/4.0/
[version]: https://github.com/Carlgo11/Teamspeak-docker/releases/latest
[workflow]: https://github.com/Carlgo11/Teamspeak-docker/actions?query=workflow%3ADocker
[workflow]: https://github.com/Carlgo11/Teamspeak-docker/actions/workflows/docker-publish.yml
[docker]: https://hub.docker.com/r/carlgo11/teamspeak
[mariadb]: https://github.com/Carlgo11/Teamspeak-docker/tree/master/examples/mariadb
[sqlite]: https://github.com/Carlgo11/Teamspeak-docker/tree/master/examples/sqlite
[examples]: https://github.com/Carlgo11/Teamspeak-docker/tree/master/examples
[ports]: https://support.teamspeak.com/hc/en-us/articles/360002712257
23 changes: 13 additions & 10 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
#!/usr/bin/env sh

umask 0077
cd /teamspeak/

# Download latest ts3 server
url=$(curl -s https://teamspeak.com/versions/server.json | jq -r '.linux.x86_64.mirrors."teamspeak.com"')
download=$(echo "$url"| sed -r 's/amd64/alpine/g')
wget -q "$download" -O teamspeak.tar.bz2
curl -s "$(echo "$url"| sed -r 's/amd64/alpine/g')" -o teamspeak.tar.bz2

# Extract ts3server files
tar -xjf teamspeak.tar.bz2 --strip-components=1

# Set up directory
[ -d "redist" ] && mv redist/* .
[ -d "files" ] || mkdir files
mkdir logs

# Set up database config
cat <<- EOF >ts3db_mariadb.ini
[config]
host='${MARIADB_HOST}'
host='${MARIADB_HOST:db}'
port='${MARIADB_PORT:-3306}'
username='${MARIADB_USER}'
username='${MARIADB_USER:teamspeak}'
password='${MARIADB_PASSWORD}'
database='${MARIADB_DATABASE}'
database='${MARIADB_DATABASE:teamspeak}'
socket='${MARIADB_SOCKET}'
wait_until_ready=20
EOF
chmod 400 ts3db_mariadb.ini
EOF

# Remove junk
for file in teamspeak.tar.bz2 doc serverquerydocs CHANGELOG LICENSE ts3server_minimal_runscript.sh ts3server_startscript.sh redist tsdns; do rm -rf $file; done

for file in teamspeak.tar.bz2 doc serverquerydocs CHANGELOG LICENSE ts3server_minimal_runscript.sh ts3server_startscript.sh redist; do rm -rf $file; done
for file in *.so *.so.2 ts3server sql sql/*/; do chmod 500 "$file"; done
# Set up permissions
for file in *.so *.so.2 ts3server sql sql/*/ .; do chmod 500 "$file"; done
chmod 400 ts3db_mariadb.ini
5 changes: 5 additions & 0 deletions example/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
MARIADB_HOST=db
MARIADB_PORT=3306
MARIADB_USER=teamspeak
MARIADB_PASSWORD=teamspeak
MARIADB_DATABASE=teamspeak
18 changes: 6 additions & 12 deletions examples/mariadb/docker-compose.yml → example/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,28 @@
version: "3"
version: "3.7"
services:

db:
image: mariadb
container_name: teamspeak_db
restart: unless-stopped
volumes:
- db:/var/lib/mysql
- "db:/var/lib/mysql"
environment:
MARIADB_RANDOM_ROOT_PASSWORD: 1
MARIADB_DATABASE: teamspeak
MARIADB_USER: teamspeak
MARIADB_PASSWORD: teamspeak
env_file: .env

teamspeak:
image: carlgo11/teamspeak
container_name: teamspeak_server
restart: unless-stopped
env_file: .env
ports:
- "9987:9987/udp" # VOIP
- "30033:30033/tcp" # File Transfer
- "30033:30033" # File Transfer
volumes:
- "./ts3server_config.ini:/teamspeak/ts3server.ini:ro"
- "files:/teamspeak/files"
environment:
MARIADB_HOST: db
MARIADB_PORT: 3306
MARIADB_USER: teamspeak
MARIADB_PASSWORD: teamspeak
MARIADB_DATABASE: teamspeak
tmpfs: "/teamspeak:exec,uid=1000,mode=700"

volumes:
db:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ filetransfer_port=30033
filetransfer_ip=0.0.0.0
query_port=10011
query_ip=
query_ip_allowlist=query_ip_whitelist.txt
query_ip_denylist=query_ip_blocklist.txt
query_ip_allowlist=/tmp/query_ip_whitelist.txt
query_ip_denylist=/tmp/query_ip_blocklist.txt
dbsqlpath=sql/
dbplugin=ts3db_mariadb
dbsqlcreatepath=create_mariadb/
Expand Down
17 changes: 0 additions & 17 deletions examples/sqlite/docker-compose.yml

This file was deleted.

19 changes: 0 additions & 19 deletions examples/sqlite/ts3server_config.ini

This file was deleted.

0 comments on commit 3bc0fc0

Please sign in to comment.