Executing a command in running docker swarm service I am trying to run a Django project in docker swarm mode. The problem is I want to index the Elastic search container which needs to be run only after postgres completes the SQL dumping process (only in the first run). How can I do this? Any solutions.
I suggest making a cronjob container that does the SQL dump and elastic index using docker exec commands toward the corresponding containers.