Container startup order #669
-
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Dockge is a front-end for docker, Dockge does not actually start the containers or maintain their state, it only displays information from docker and allows you to send commands to docker. You can set the depends on of each container to have some control over start-up order. One method you can use but it depends on the containers you're spinning up would be to use a healthcheck by setting a script to run in the container prior to the application starting (that's the part that depends on the container because some may require creating your own docker file to actually run the script prior to application startup). Basically a bash script to check for a healthy status (use wget or curl assuming the container has a web based health check for example) and if it doesn't return healthy (or whatever the healthy return value is) then sleep 1; or 10 or whatever you want to use for the check frequency and put it in a loop based on that result. if the container you're going to run has docker socket access then you can even use docker inspect to get the health status instead of wget or curl. the only problem with this solution is that if the dependency goes down, then the script you have in place will not be of any use as it would need to be called again to begin waiting for the other service again. if you can put all the services in the same compose file and use depends on, that will simplify the process greatly and increase reliability. |
Beta Was this translation helpful? Give feedback.
Dockge is a front-end for docker, Dockge does not actually start the containers or maintain their state, it only displays information from docker and allows you to send commands to docker.
You can set the depends on of each container to have some control over start-up order. One method you can use but it depends on the containers you're spinning up would be to use a healthcheck by setting a script to run in the container prior to the application starting (that's the part that depends on the container because some may require creating your own docker file to actually run the script prior to application startup). Basically a bash script to check for a healthy status (use wget or curl assumi…