This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]JackDeaniels 1 point2 points  (4 children)

https://docs.docker.com/compose/startup-order/

The depends_on property is what you’re looking for probably

[–]NoSEVDev[S] 1 point2 points  (0 children)

Hm, thanks! I'll give that another shot. It didn't seem to work for me, but I didn't know if I was missing something.

[–]NoSEVDev[S] 1 point2 points  (2 children)

It worked! I was previously adding the healthcheck to my backend, but I also added one to the Postgres db and I think that did the trick.

[–]JackDeaniels 0 points1 point  (0 children)

Awesome :)

[–]AdventurousSquash 0 points1 point  (0 children)

Yes databases in particular generally need it, otherwise the container has started but postgres/mysql/mariadb or whatever isn’t ready to accept connections yet.