docker-compose is not restarting my container even if it is listed with an exit code 2 is docker-compose ps
.
Name Command State Ports
-----------------------------------------------------------------------------
app_autoheal_1 /docker-entrypoint autoheal Up (healthy)
seafile /sbin/my_init -- /scripts/ ... Exit 2
It is defined in the docker-compose.yaml
with restart: always
.
version: '3.4'
services:
autoheal:
restart: always
image: willfarrell/autoheal
environment:
- AUTOHEAL_CONTAINER_LABEL=all
volumes:
- /var/run/docker.sock:/var/run/docker.sock
seafile:
image: seafileltd/seafile-mc:latest
restart: always
container_name: seafile
healthcheck:
test: ["CMD-SHELL", "test $$(curl -k https://localhost/api2/ping/) = '\"pong\"'"]
interval: 30s
timeout: 20s
retries: 3
start_period: 30s
In which cases can this happen?