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

Sample Docker Compose #57

Open
neillfontes-klar opened this issue May 16, 2023 · 0 comments
Open

Sample Docker Compose #57

neillfontes-klar opened this issue May 16, 2023 · 0 comments

Comments

@neillfontes-klar
Copy link

If anyone needs a docker-compose.yaml for local testing, the one below can be leveraged:

version: "3"

services:

  postgres:
    image: postgres
    healthcheck:
      test: pg_isready -U postgres
      interval: 5s
      timeout: 3s
      retries: 3
      start_period: 1s
    hostname: postgres
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: password
      POSTGRES_DB: postgres
    networks:
      - net

  pact_broker:
    image: pactfoundation/pact-broker
    ports:
      - "8000:9292"
    hostname: broker
    depends_on:
      postgres:
        condition: service_healthy
    healthcheck:
      test: netstat -tuln | grep -q :9292
      interval: 5s
      timeout: 3s
      retries: 3
      start_period: 1s
    links:
      - postgres
    environment:
      PACT_BROKER_BASIC_AUTH_USERNAME: pact_workshop
      PACT_BROKER_BASIC_AUTH_PASSWORD: pact_workshop
      PACT_BROKER_DATABASE_USERNAME: postgres
      PACT_BROKER_DATABASE_PASSWORD: password
      PACT_BROKER_DATABASE_HOST: postgres
      PACT_BROKER_DATABASE_NAME: postgres
    networks:
      - net

  pact_stub:
    image: pactfoundation/pact-stub-server
    ports:
      - "8080:8080"
    hostname: stub
    depends_on:
      pact_broker:
        condition: service_healthy
    command:
      --port 8080
      --broker-url http://host.docker.internal:8000
      --user pact_workshop:pact_workshop
      --loglevel debug
    networks:
      - net

networks:
  net:
    driver: bridge

Not necessarily a question/issue but it might be useful for others.

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

1 participant