I have a mongodb service and a test service running with docker-compose:
services:
mongo:
image: myrepo/mongo
ports:
- "27017:27017"
test:
depends_on:
- mongo
image: myrepo/elixir-tests
command: sh start.sh
in the start.sh script i am trying to run:
mongo 172.20.0.10:27017/wc-app-sandbox --eval "printjson(....))"
but i get the following error :
start.sh: 10: start.sh: mongo: not found
My question is: why does the error happen- doesn't the depends_on property suppose to automatically include service dependencies? as mention here:
depends_on
Express dependency between services, which has two effects:
docker-compose up will start services in dependency order. In the following example, db and redis will be started before web. docker-compose up SERVICE will automatically include SERVICE’s dependencies. In the following example, docker-compose up web will also create and start db and redis.