dockerize
dockerize copied to clipboard
Example for using this on docker-compose?
I am trying to figure out how to use this with docker-compose. As I have a need to slowdown another docker image and depends_on doesnt help.
How to use this on docker-compose?
I see the examples as: $ dockerize -wait tcp://db:5432 -wait http://web:80 -wait file:///tmp/generated-file
Does it mean that it needs to be defined in CMD command in the compose file? Any examples?
This tutorial shows one example:
version: '3.1'
services:
db:
image: postgres
environment:
POSTGRES_USER: john
POSTGRES_PASSWORD: mysecretpassword
expose:
- 5432
myapp:
build: .
image: myapp
command: yarn start
environment:
APP_DB_HOST: db
APP_DB_USER: john
APP_DB_PASSWORD: mysecretpassword
expose:
- 8000
depends_on:
- db
myapp-tests:
image: myapp
command: dockerize
-wait tcp://db:5432 -wait tcp://myapp:8000 -timeout 10s
bash -c "node db/init.js && yarn test"
environment:
APP_URL: http://myapp:8000
APP_DB_HOST: db
APP_DB_USER: john
APP_DB_PASSWORD: mysecretpassword
depends_on:
- db
- myapp
h/t @jpdelima