Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example for using this on docker-compose? #136

Open
thepenguinthatwants opened this issue Jul 23, 2019 · 1 comment
Open

Example for using this on docker-compose? #136

thepenguinthatwants opened this issue Jul 23, 2019 · 1 comment

Comments

@thepenguinthatwants
Copy link

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?

@clhenrick
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants