Restarts Docker containers automatically on a schedule.
1.3K
Restarts Docker containers automatically on a schedule.
services:
container:
# Container configuration here.
backup:
image: jmqm/docker_container_restarter:latest
container_name: container_restarter
network_mode: none
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /etc/localtime:/etc/localtime:ro # Container uses date from host.
environment:
- CONTAINERS=container # One or more, separated by spaces
- OPTIONS=--time 300 # Five minutes to wait before killing container(s)
- SCHEDULE=0 5 * * * # 5:00 AM daily
depends_on
- container
/var/run/docker.sock (read/write)| Environment Variable | Info |
|---|---|
| CONTAINERS ⭐ | Name of the containers to restart, separated by commas. |
| SCHEDULE ⭐ | When to run (default is 5:00 AM). Info here and editor here. |
| OPTIONS 👍 | Options to pass to command docker restart. Docs here. |
| Environment Variable | Info |
|---|---|
| TZ ¹ | Timezone inside the container. Can mount /etc/localtime instead as well (recommended). |
¹ See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for more information
Content type
Image
Digest
sha256:49277d61f…
Size
16.2 MB
Last updated
about 4 years ago
docker pull jmqm/docker_container_restarter