Correct race condition that prevents server from working after reboot

When Docker is managing the startup of containers, the existing seafile-server.yml is failing to come up properly due to a race condition: the MySQL container is up, but not yet ready to accept connections and it's causing the process in the server container to die.

Since a proper healthcheck already exists in the compose file, this PR adds the correct status check for db and makes the memcached one more verbose in case anyone wants to implement a health check there as well.

Someone should also probably look into making the server more fault tolerant of db errors, but this solves the problem for today.
This commit is contained in:
TerryMathews 2025-01-17 19:58:23 -05:00 committed by GitHub
parent 0dffcd841e
commit 2e3daee720
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -62,11 +62,13 @@ services:
caddy: ${SEAFILE_SERVER_PROTOCOL:-http}://${SEAFILE_SERVER_HOSTNAME:?Variable is not set or empty}
caddy.reverse_proxy: "{{upstreams 80}}"
depends_on:
- db
- memcached
db:
condition: service_healthy
memcached:
condition: service_started
networks:
- seafile-net
networks:
seafile-net:
name: seafile-net
name: seafile-net