docker-compose 将 teamspeak 数据目录作为卷安装时出现问题

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

我正在尝试启动 teamspeak 容器并将 sqlite 文件挂载到主机。我使用全新安装的 docker 引擎和 docker-compose。我还没有以非 root 用户 (docs). That's why I think I have problems when I mount the TS data folder /opt/ts3server/sql/ (docs) 的身份将 post 安装设置到 运行 docker 到我的主机系统。 ./teamspeak/ 文件夹拥有根目录,但我也为所有人提供了 r-w-x。

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

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

当我设置 /opt/ts3server/sql/ 以外的任何其他设置时,teamspeak 服务器启动。 我怎样才能使已安装的卷对 teamspeak 可读写?

假设你想挂载TS3服务器的数据目录。您安装的卷 (/opt/ts3server/sql/) 用于存储 sql 脚本以创建数据库。

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

您想要将数据目录 (/var/ts3server/) 挂载到主机系统:

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