dockerize icon indicating copy to clipboard operation
dockerize copied to clipboard

Example for using this on docker-compose?

Open thepenguinthatwants opened this issue 6 years ago • 1 comments

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?

thepenguinthatwants avatar Jul 23 '19 07:07 thepenguinthatwants

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

clhenrick avatar Mar 25 '20 23:03 clhenrick