docker创建seafile12.0遇到的两个问题

完全按照教程部署的,仅修改了caddy的主机映射端口,180:80,1443:443,防火墙也放开了180,1443,6233几个端口。在.env文件中将seafile.example.com字段改为了主机的局域网ip地址。部署前已在/opt/seafile下载好了各yml文件,在/opt/seafile-data/seafile/conf目录设置了seafdav.conf seafile.conf seahub_settings.py三个文件。遇到以下问题:

问题1:lucaslorentz/caddy-docker-proxy:2.9镜像,docker ps的STATUS显示unhealthy

健康检查日志显示:

OCI runtime exec failed: exec failed: unable to start container process: exec: "/bin/sh": stat /bin/sh: no such file or directory: unknown。

问题2:notification-server容器一直重启,日志显示:

[ERROR] Failed to connected to mysql: Error 1045: Access denied for user 'seafile'@'172.18.0.7' (using password: YES)。

进入mysql容器(即mariadb:10.11)检查发现并没有seafile用户。
mysql容器日志如下:

2024-12-31 15:18:28+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.11.10+maria~ubu2204 started.
2024-12-31 15:18:28+00:00 [Warn] [Entrypoint]: /sys/fs/cgroup///memory.pressure not writable, functionality unavailable to MariaDB
2024-12-31 15:18:28+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2024-12-31 15:18:28+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.11.10+maria~ubu2204 started.
2024-12-31 15:18:29+00:00 [Note] [Entrypoint]: MariaDB upgrade not required
2024-12-31 15:18:29 0 [Note] Starting MariaDB 10.11.10-MariaDB-ubu2204 source revision 3d0fb150289716ca75cd64d62823cf715ee47646 server_uid 5WChtxxgV/VZkvpXNaDAgEZEcZs= as process 1
2024-12-31 15:18:29 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2024-12-31 15:18:29 0 [Note] InnoDB: Number of transaction pools: 1
2024-12-31 15:18:29 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2024-12-31 15:18:29 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)
2024-12-31 15:18:29 0 [Warning] mariadbd: io_uring_queue_init() failed with errno 1
2024-12-31 15:18:29 0 [Warning] InnoDB: liburing disabled: falling back to innodb_use_native_aio=OFF
2024-12-31 15:18:29 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB
2024-12-31 15:18:29 0 [Note] InnoDB: Completed initialization of buffer pool
2024-12-31 15:18:29 0 [Note] InnoDB: File system buffers for log disabled (block size=512 bytes)
2024-12-31 15:18:29 0 [Note] InnoDB: End of log at LSN=46862
2024-12-31 15:18:29 0 [Note] InnoDB: 128 rollback segments are active.
2024-12-31 15:18:29 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ...
2024-12-31 15:18:29 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB.
2024-12-31 15:18:29 0 [Note] InnoDB: log sequence number 46862; transaction id 14
2024-12-31 15:18:29 0 [Note] Plugin 'FEEDBACK' is disabled.
2024-12-31 15:18:29 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2024-12-31 15:18:29 0 [Warning] You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work.
2024-12-31 15:18:29 0 [Note] InnoDB: Buffer pool(s) load completed at 241231 15:18:29
2024-12-31 15:18:29 0 [Note] Server socket created on IP: '0.0.0.0'.
2024-12-31 15:18:29 0 [Note] Server socket created on IP: '::'.
2024-12-31 15:18:29 0 [Note] mariadbd: ready for connections.
Version: '10.11.10-MariaDB-ubu2204'  socket: '/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
2024-12-31 15:18:29 3 [Warning] Access denied for user 'seafile'@'172.18.0.8' (using password: YES)
2024-12-31 15:18:30 4 [Warning] Access denied for user 'seafile'@'172.18.0.8' (using password: YES)
2024-12-31 15:18:31 5 [Warning] Access denied for user 'seafile'@'172.18.0.8' (using password: YES)
2024-12-31 15:18:32 6 [Warning] Access denied for user 'seafile'@'172.18.0.8' (using password: YES)
2024-12-31 15:18:34 9 [Warning] Access denied for user 'seafile'@'172.18.0.8' (using password: YES)

seafile的日志显示如下:

*** Running /etc/my_init.d/01_create_data_links.sh...
*** Booting runit daemon...
*** Runit started as PID 18
*** Running /scripts/enterpoint.sh...
2024-12-31 23:18:29 Nginx ready
2024-12-31 23:18:29 This is an idle script (infinite loop) to keep container running.
Traceback (most recent call last):
  File "/scripts/start.py", line 94, in <module>
    main()
  File "/scripts/start.py", line 58, in main
    wait_for_mysql()
  File "/scripts/utils.py", line 281, in wait_for_mysql
    db_host = cp.get('database', 'host')
              ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/configparser.py", line 759, in get
    d = self._unify_values(section, vars)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/configparser.py", line 1132, in _unify_values
    raise NoSectionError(section) from None
configparser.NoSectionError: No section: 'database'

seafile容器内执行env显示.env文件中设置的各个环境变量均存在。

请问各位部署的时候有没有遇到相同问题,是如何解决的?多谢!
已经试过了社区里https://bbs.seafile.com/t/topic/20966这个帖子的方法,未能解决。

另外,中文的pro版本部署教程中下载yml文件的命令写错了,下载的是ce版的。英文教程中没有错

wget -O .env https://manual.seafile.com/12.0/docker/ce/env
wget https://manual.seafile.com/12.0/docker/ce/seafile-server.yml

我的.env文件设置如下,其中100.100.100.1这个地址是我headscale异地组网中为服务器分配的ip地址,密码变量设置那里有无引号均会复现上述问题,pro版本和ce版本的seafile镜像都均会复现上述问题:

COMPOSE_FILE='seafile-server.yml,caddy.yml,seadoc.yml,onlyoffice.yml,clamav.yml,notification-server.yml'
COMPOSE_PATH_SEPARATOR=','


SEAFILE_IMAGE=seafileltd/seafile-pro-mc:12.0-latest
SEAFILE_DB_IMAGE=mariadb:10.11
SEAFILE_MEMCACHED_IMAGE=memcached:1.6.29
SEAFILE_ELASTICSEARCH_IMAGE=elasticsearch:8.15.0
SEAFILE_CADDY_IMAGE=lucaslorentz/caddy-docker-proxy:2.9

SEAFILE_VOLUME=/opt/seafile-data
SEAFILE_MYSQL_VOLUME=/opt/seafile-mysql/db
SEAFILE_ELASTICSEARCH_VOLUME=/opt/seafile-elasticsearch/data
SEAFILE_CADDY_VOLUME=/opt/seafile-caddy

SEAFILE_MYSQL_DB_HOST=db
INIT_SEAFILE_MYSQL_ROOT_PASSWORD="ROOT_PASSWORD"
SEAFILE_MYSQL_DB_USER=seafile
SEAFILE_MYSQL_DB_PASSWORD="PASSWORD"

TIME_ZONE=Asia/Shanghai

JWT_PRIVATE_KEY=g7fTQGBX7uUHLNaLXeAAQLHs9RjzFfMGu2X5HXaA

SEAFILE_SERVER_HOSTNAME=100.100.100.1
SEAFILE_SERVER_PROTOCOL=http

INIT_SEAFILE_ADMIN_EMAIL=admin@omv.local
INIT_SEAFILE_ADMIN_PASSWORD=mypasswd
INIT_S3_STORAGE_BACKEND_CONFIG=false
INIT_S3_COMMIT_BUCKET=<your-commit-objects>
INIT_S3_FS_BUCKET=<your-fs-objects>
INIT_S3_BLOCK_BUCKET=<your-block-objects>
INIT_S3_KEY_ID=<your-key-id>
INIT_S3_SECRET_KEY=<your-secret-key>
INIT_S3_USE_V4_SIGNATURE=true
INIT_S3_AWS_REGION=us-east-1
INIT_S3_HOST=s3.us-east-1.amazonaws.com
INIT_S3_USE_HTTPS=true

SEADOC_IMAGE=seafileltd/sdoc-server:1.0-latest
SEADOC_VOLUME=/opt/seadoc-data

ENABLE_SEADOC=true
SEADOC_SERVER_URL=http://100.100.100.1/sdoc-server

NOTIFICATION_SERVER_IMAGE=seafileltd/notification-server:12.0-latest
NOTIFICATION_SERVER_VOLUME=/opt/notification-data

ONLYOFFICE_IMAGE=onlyoffice/documentserver:8.1.0.1
ONLYOFFICE_VOLUME=/opt/onlyoffice
ONLYOFFICE_PORT=6233
ONLYOFFICE_JWT_SECRET=g7fTQGBX7uUHLNaLXeAAQLHs9RjzFfMGu2X5HXaA

对于问题2,

我进入MariaDB容器,docker exec -it seafile-mysql mysql -u root -p
运行以下SQL命令:

CREATE DATABASE ccnet_db CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE DATABASE seafile_db CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE DATABASE seahub_db CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;

CREATE USER 'seafile'@'%' IDENTIFIED BY 'PASSWORD';
GRANT ALL PRIVILEGES ON ccnet_db.* TO 'seafile'@'%';
GRANT ALL PRIVILEGES ON seafile_db.* TO 'seafile'@'%';
GRANT ALL PRIVILEGES ON seahub_db.* TO 'seafile'@'%';
FLUSH PRIVILEGES;

手动创建了数据库后问题似乎得到了解决, 访问http://127.0.0.1:8083/ping,返回 {"ret" : "pong"} ( 在 notification-server.yml 中暴露8083端口)
但是为什么初始化没有创建好设置的数据库仍然未知,待解决。

对于问题1,

错误提示表明 lucaslorentz/caddy-docker-proxy:2.9 镜像中没有 sh(Shell 环境)。这是因为该镜像是一个精简的容器镜像(通常基于 scratchdistroless),不包含 Shell 或常见的工具。目前该问题仍未解决(onlyoffice的6233端口可以正常访问,但是映射的180:80一直返回502,等了很久也是返回502。将caddy的2019端口映射出来,:2019/metrics也是无法访问的)

对于问题1,建议先使用默认端口测试服务是否正常