I have seafile-docker set-up inside Portainer, with my own caddy docker (external network), because I use Caddy for multiple projects. I have removed all caddy docker related things from the compose file. However, when I run the stack, it works as expecting through my external caddy. But when I reboot the host Portainer is running on, it seems to crash the seafile stack boot, and I can see that caddy-seafile is inside the stack. I have no idea where it keeps coming from and why it's only on a server reboot.
This is happening on Seafile 12.x on an Ubuntu system running the latest Portainer. Below is my compose file.
x-global: &global
restart: unless-stopped
# user: 1002:1002
environment:
# - PUID=1002
# - PGID=1002
- TZ=Europe/Brussels
services:
db:
<<: *global
image: ${SEAFILE_DB_IMAGE:-mariadb:10.11}
container_name: seafile-mysql
restart: unless-stopped
environment:
- MYSQL_ROOT_PASSWORD=${INIT_SEAFILE_MYSQL_ROOT_PASSWORD:-}
- MYSQL_LOG_CONSOLE=true
- MARIADB_AUTO_UPGRADE=1
volumes:
- "${SEAFILE_MYSQL_VOLUME:-/opt/seafile-mysql/db}:/var/lib/mysql"
networks:
- caddy-network
healthcheck:
test:
[
"CMD",
"/usr/local/bin/healthcheck.sh",
"--connect",
"--mariadbupgrade",
"--innodb_initialized",
]
interval: 20s
start_period: 30s
timeout: 5s
retries: 10
memcached:
<<: *global
image: ${SEAFILE_MEMCACHED_IMAGE:-memcached:1.6.29}
container_name: seafile-memcached
restart: unless-stopped
entrypoint: memcached -m 256
networks:
- caddy-network
seafile:
<<: *global
image: ${SEAFILE_IMAGE:-seafileltd/seafile-mc:12.0-latest}
container_name: seafile
restart: unless-stopped
#ports:
#- "80:80"
#- "443:443"
volumes:
- ${SEAFILE_VOLUME:-/opt/seafile-data}:/shared
environment:
- DB_HOST=${SEAFILE_MYSQL_DB_HOST:-db}
- DB_PORT=${SEAFILE_MYSQL_DB_PORT:-3306}
- DB_USER=${SEAFILE_MYSQL_DB_USER:-seafile}
- DB_ROOT_PASSWD=${INIT_SEAFILE_MYSQL_ROOT_PASSWORD:-}
- DB_PASSWORD=${SEAFILE_MYSQL_DB_PASSWORD:?Variable is not set or empty}
- SEAFILE_MYSQL_DB_CCNET_DB_NAME=${SEAFILE_MYSQL_DB_CCNET_DB_NAME:-ccnet_db}
- SEAFILE_MYSQL_DB_SEAFILE_DB_NAME=${SEAFILE_MYSQL_DB_SEAFILE_DB_NAME:-seafile_db}
- SEAFILE_MYSQL_DB_SEAHUB_DB_NAME=${SEAFILE_MYSQL_DB_SEAHUB_DB_NAME:-seahub_db}
- TIME_ZONE=${TIME_ZONE:-Etc/UTC}
- INIT_SEAFILE_ADMIN_EMAIL=${INIT_SEAFILE_ADMIN_EMAIL:-me@example.com}
- INIT_SEAFILE_ADMIN_PASSWORD=${INIT_SEAFILE_ADMIN_PASSWORD:-asecret}
- SEAFILE_SERVER_HOSTNAME=${SEAFILE_SERVER_HOSTNAME:?Variable is not set or empty}
- SEAFILE_SERVER_PROTOCOL=${SEAFILE_SERVER_PROTOCOL:-http}
- SITE_ROOT=${SITE_ROOT:-/}
- NON_ROOT=${NON_ROOT:-false}
- JWT_PRIVATE_KEY=${JWT_PRIVATE_KEY:?Variable is not set or empty}
- SEAFILE_LOG_TO_STDOUT=${SEAFILE_LOG_TO_STDOUT:-false}
- ENABLE_SEADOC=${ENABLE_SEADOC:-true}
- SEADOC_SERVER_URL=${SEAFILE_SERVER_PROTOCOL:-http}://${SEAFILE_SERVER_HOSTNAME:?Variable is not set or empty}/sdoc-server
labels:
caddy_0: https://${SEAFILE_SERVER_HOSTNAME:?Variable is not set or empty}
caddy_0.reverse_proxy: "{{upstreams 80}}"
depends_on:
db:
condition: service_healthy
memcached:
condition: service_started
networks:
- caddy-network
notification-server:
<<: *global
image: ${NOTIFICATION_SERVER_IMAGE:-seafileltd/notification-server:12.0-latest}
container_name: notification-server
restart: unless-stopped
volumes:
- ${NOTIFICATION_SERVER_VOLUME:-/opt/notification-data}:/shared
- ${NOTIFICATION_SERVER_VOLUME:-/opt/notification-data}/logs:/shared/logs
# ports:
# - "8083:8083"
environment:
- SEAFILE_MYSQL_DB_HOST=${SEAFILE_MYSQL_DB_HOST:-db}
- SEAFILE_MYSQL_DB_PORT=${SEAFILE_MYSQL_DB_PORT:-3306}
- SEAFILE_MYSQL_DB_USER=${SEAFILE_MYSQL_DB_USER:-seafile}
- SEAFILE_MYSQL_DB_PASSWORD=${SEAFILE_MYSQL_DB_PASSWORD:?Variable is not set or empty}
- SEAFILE_MYSQL_DB_CCNET_DB_NAME=${SEAFILE_MYSQL_DB_CCNET_DB_NAME:-ccnet_db}
- SEAFILE_MYSQL_DB_SEAFILE_DB_NAME=${SEAFILE_MYSQL_DB_SEAFILE_DB_NAME:-seafile_db}
- JWT_PRIVATE_KEY=${JWT_PRIVATE_KEY:?Variable is not set or empty}
- SEAFILE_LOG_TO_STDOUT=${SEAFILE_LOG_TO_STDOUT:-false}
- NOTIFICATION_SERVER_LOG_LEVEL=${NOTIFICATION_SERVER_LOG_LEVEL:-info}
labels:
caddy: https://${SEAFILE_SERVER_HOSTNAME:?Variable is not set or empty}
caddy.@ws.0_header: "Connection *Upgrade*"
caddy.@ws.1_header: "Upgrade websocket"
caddy.0_reverse_proxy: "@ws {{upstreams 8083}}"
caddy.1_handle_path: "/notification*"
caddy.1_handle_path.0_rewrite: "* {uri}"
caddy.1_handle_path.1_reverse_proxy: "{{upstreams 8083}}"
depends_on:
db:
condition: service_healthy
networks:
- caddy-network
networks:
caddy-network:
external: true
I have seafile-docker set-up inside Portainer, with my own caddy docker (external network), because I use Caddy for multiple projects. I have removed all caddy docker related things from the compose file. However, when I run the stack, it works as expecting through my external caddy. But when I reboot the host Portainer is running on, it seems to crash the seafile stack boot, and I can see that caddy-seafile is inside the stack. I have no idea where it keeps coming from and why it's only on a server reboot.
This is happening on Seafile 12.x on an Ubuntu system running the latest Portainer. Below is my compose file.