1

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.

1 Answer 1

1

I suggest making a cronjob container that does the SQL dump and elastic index using docker exec commands toward the corresponding containers.

2
  • but cron will not know if the DB import has been completed or not. if the import task is not complete then elastic search indexing will produce an error
    – Bikram
    Aug 27, 2018 at 4:22
  • @Bikram wait for your dump task to exit and check its return code before running the ES indexing in one cron
    – HenriTel
    Sep 3, 2018 at 13:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.