Seafile/seahub not available after start

I have seafile as a service on my RaspberryPi4, it works normally, but sometimes after rpi4 restart I can see 502 errors, which comes from Seafile.

/opt/seafile-data/logs/var-log/nginx/seahub.error.log

2024/05/26 15:39:11 [error] 53#53: *56 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.1.139, server: *****, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8000/", host: "192.168.1.50:8000"

but other logs don’t show more errors:

sudo docker logs --since=1h be9fe480aba7
Seahub is started
Done.

/opt/seafile-data/seafile/logs/seahub.logs
2024-05-26 17:22:11,486 [INFO] seafevents.db:69 create_engine_from_conf [seafevents] database: mysql, name: seahub_db

after another RPi4 restart everything works fine.
What could be the problem? where to look for it ?

I guess it’s not a problem with reverse-proxy, as I couldn’t access dockerized nginx (part of seafile as well):

wget localhost:8000

--2024-05-26 21:35:26--  http://localhost:8000/
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:8000... connected.
HTTP request sent, awaiting response... 502 Bad Gateway
2024-05-26 21:35:26 ERROR 502: Bad Gateway.

and aforementioned errors in seahub.error.log