-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to keep alive containers? #3200
Comments
Due to the lack of information avaliable, i took a lot of pieces from everywhere to solve this issue. First and according to the docker documentation, i created the daemon.json file at directory /etc/docker/daemon.json
This is just a solution in case the docker daemon stops, containers will not be affected, but it's not the final solution to "keep alive containers". So according to the Docker Documentation, restart always is the policy we need to add in every container we want to use. In case of laradock, edit your docker-compose.yml file the policy restart : always Example So in every yml block i added the policy, example, nginx
and you need to do that with every container you'll use in your project. Finally i installed supervisor in the server, which will be different than the containerized supervisor in laradock containers.
In this case, the process will run every 60 second, but you can adapt it to your needs. Finally, everytime this process runs, your output should be like:
In case a container stops, the log should say "recreated". |
Avoid Downtime
I've been using Laradock for a long time and maybe restart containers with a single command is not a huge deal, but sometimes on weekends, containers just stops. This is a problem whem i'm out of the office.
A workaround that comes to my mind is to restart all containers with an script using the OS, but maybe is not the best choice to accomplish this.
I saw this guide in docker documentation, and also this command CMD tail -f /dev/null but how could we apply it to Laradock.
Is there any way to keep alive docker containers using this package?
The text was updated successfully, but these errors were encountered: