Is it possible to control the order of starting containers in Docker-compose beside the following method?
https://docs.docker.com/compose/startup-order/
version: "2"
services:
web:
build: .
ports:
- "80:8000"
depends_on:
- "db"
command: ["./wait-for-it.sh", "db:5432", "--", "python", "app.py"]
db:
image: postgres
I have a container which depends on a redis databse container. However, it takes longer for redis to load in memory which causes the first container to exit. For now, I am using always restart method to deal with the problem as a workaround.
I was wondering if there is a better alternative as I would try to avoid the wait for it script?