[Docker] Complete server reset on host reboot

As the title states, my entire instance gets wiped when I reboot my actual server, even after gracefully shutting down the docker instance running the TeamSpeak server.

I’m running it through docker-compose and the config is very minimalistic yet straight-forward:
version: ‘3.1’

services:
  teamspeak:
    image: "teamspeak"
    restart: "always"
    ports:
      - "9987:9987/udp"
      - "10011:10011"
      - "30033:30033"
    environment:
      TS3SERVER_LICENSE: "accept"
      TS3SERVER_DB_PLUGIN: "ts3db_mariadb"
      TS3SERVER_DB_SQLCREATEPATH: "create_mariadb"
      TS3SERVER_DB_HOST: "ts_db"
      TS3SERVER_DB_USER: "root"
      TS3SERVER_DB_PASSWORD: "nope :)"
      TS3SERVER_DB_NAME: "ts3"
      TS3SERVER_DB_WAITUNTILREADY: 10
    volumes:
      - "./data:/var/ts3server"
  ts_db:
    image: mariadb
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: "nope :)"
      MYSQL_DATABASE: "ts3"

I’m surprised it works at all to begin with.

First, there’s no reason at all to use MySQL, but even if you do, do not use a user with SUPER privilege. At best you will have collation issues, at worst, you won’t be able to operate database at all, as it is limited in access rights to maintenance purposes only.

Honestly surprised.
I’ve grabbed most of that config from the example part of the official docker hub/github repository of TeamSpeak, thinking it would work out of the box.

Judging by that I guess there is no real need for you to run with anything but sqlite.
So changing your config to this:

services:
  teamspeak:
    image: "teamspeak"
    restart: "always"
    ports:
      - "9987:9987/udp"
      - "10011:10011"
      - "30033:30033"
    environment:
      TS3SERVER_LICENSE: "accept"
    volumes:
      - "./data:/var/ts3server"

should do the trick.

Your ts_db is missing a volume or mount to persist it’s data (/var/lib/mysql).

Something like

  volumes:
    - "./db:/var/lib/mysql"
twitch instagram twitter facebook