Search code examples
dockerdocker-composeteamspeak

docker-compose problems mounting the teamspeak data directory as a volume


I'm trying to start a teamspeak container and mount the sqlite files to the host. I use a fresh installed docker engine and docker-compose. I haven't done the post installation setup to run docker as non-root user (docs). That's why I think I have problems when I mount the TS data folder /opt/ts3server/sql/ (docs) to my host system. The ./teamspeak/ folder owns root but I gave it also r-w-x for everyone.

docker-compose.yaml:

version: '3'
services:
  teamspeak:
    user: root
    image: teamspeak
    restart: always
    ports:
      - 9987:9987/udp
      - 10011:10011
      - 30033:30033
    volumes:
      - ./teamspeak/:/opt/ts3server/sql/
    environment:
      TS3SERVER_LICENSE: accept

error logs from teamspeak:

teamspeak_1 | 2019-10-25 20:18:33.827157|INFO |ServerLibPriv | |TeamSpeak 3 Server 3.9.1 (2019-07-02 13:17:23)

teamspeak_1 | 2019-10-25 20:18:33.827272|INFO |ServerLibPriv | |SystemInformation: Linux 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u1 (2019-09-20) x86_64 Binary: 64bit

teamspeak_1 | 2019-10-25 20:18:33.827300|INFO |ServerLibPriv | |Using hardware aes

teamspeak_1 | 2019-10-25 20:18:33.827484|INFO |DatabaseQuery | |dbPlugin name: SQLite3 plugin, Version 3, (c)TeamSpeak Systems GmbH

teamspeak_1 | 2019-10-25 20:18:33.827513|INFO |DatabaseQuery | |dbPlugin version: 3.11.1

teamspeak_1 | 2019-10-25 20:18:33.827614|INFO |DatabaseQuery | |checking database integrity (may take a while)

teamspeak_1 | 2019-10-25 20:18:33.844497|CRITICAL|DatabaseQuery | |setSQLfromFile( file:properties_list_by_string_id.sql) failed

When I set anything else than /opt/ts3server/sql/ the teamspeak server starts. How can I make the mounted volume read and writable for teamspeak?


Solution

  • I assume you want to mount the data directory of the TS3 server. The volume you mounted (/opt/ts3server/sql/) is used to store the sql scripts to create the database.

    This variable controls where the TeamSpeak server looks for sql files. Defaults to /opt/ts3server/sql/.
    - teamspeak docker docu

    you instead want to mount the data directory (/var/ts3server/) to the host sytsem:

    version: '3'
    services:
      teamspeak:
        user: root
        image: teamspeak
        restart: always
        ports:
          - 9987:9987/udp
          - 10011:10011
          - 30033:30033
        volumes:
          - ./teamspeak/:/var/ts3server/
        environment:
          TS3SERVER_LICENSE: accept