ufoscout / docker-compose-wait

A simple script to wait for other docker images to be started while using docker-compose (or Kubernetes or docker stack or whatever)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implementation example

DotAmzi opened this issue · comments

I am having a doubt about how to implement it on my own code, i have 3 images:
-Project image
-MongoDb image
-MariaDb image

I have followed the steps, but i think i am doing something wrong when implementing it.
Can you give me an example with those images of a docker-compose.yml using it on practice

here is some example of what is happening in mine docker-compose up --build
captura de tela 2018-06-29 as 18 27 45

Hi @camilofernandesalves
in your Dockerfile, your CMD should call wait and then your application startup script or executable, for example:
CMD /wait && /StartupOfMyApp.sh

If your CMD contains only wait, then, after the waiting pause, your container will end its execution.

hi @camilofernandesalves and @ufoscout

Sorry for budding in, but I think the documentation is pretty clear, so this issue triggered curiosity.

@camilofernandesalves what was the cause of your confusion?

@ufoscout what you describe, is that an anti-pattern which should be documented?

Have a nice weekend,

jonasbn

@camilofernandesalves
did you solve your issue?

Closing for now. I'll reopen it if more feedback is provided.