Last active
September 10, 2024 08:54
-
-
Save kizzx2/782b500a81ce46b889903b1f80353f21 to your computer and use it in GitHub Desktop.
Restart a docker container periodically with docker-compose
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
app: | |
image: nginx:alpine | |
ports: ["80:80"] | |
restart: unless-stopped | |
restarter: | |
image: docker:cli | |
volumes: ["/var/run/docker.sock:/var/run/docker.sock"] | |
command: ["/bin/sh", "-c", "while true; do sleep 86400; docker restart app_app_1; done"] | |
restart: unless-stopped |
Thanks. This is exactly what I was looking for.
Thanks. Best solution I've found.
Excellent. Thank you for the work.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@kizzx2 Thats Work as simple as that
thanks