Closed shrikeh closed 2 years ago
It could be this:
ports:
- "9010:${PACT_BROKER_PORT:-9292}"
Is that not mapping the internal port (defined by ${PACT_BROKER_PORT:-9292}
) to 9010
Here is a working docker compose example:
version: "3.9"
services:
pact-broker:
image: pactfoundation/pact-broker:2.81.0.1
environment:
PACT_BROKER_DATABASE_URL: "postgres://postgres:password@pact-broker-db/postgres"
PACT_BROKER_PORT: "9292"
PACT_BROKER_BASE_URL: 'https://localhost http://localhost http://localhost:9292 http://pact-broker:9292'
depends_on:
- pact-broker-db
expose:
- "9292"
ports:
- "9292:9292"
pact-broker-db:
image: postgres:13.4-alpine3.14
restart: always
healthcheck:
test: "psql postgres --command 'select 1' -U postgres"
volumes:
- pact-postgres:/var/lib/postgresql/data
environment:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
expose:
- "5432"
pact-stub:
image: pactfoundation/pact-stub-server:v0.4.4
entrypoint: "/bin/bash -c 'sleep 5 && ./pact-stub-server --port 8082'"
environment:
PACT_BROKER_BASE_URL: "http://pact-broker:9292/"
volumes:
# Not used when pact-broker is running
- ./tests/pacts:/pacts:ro
depends_on:
- pact-broker
ports:
- "8082:8082"
volumes:
pact-postgres:
Hi there,
Been trying to get the stub-server working with a local pact-broker for quick prototyping. However, I appear to always get the following:
Here is my abridged
docker-compose.yml
file:For the purposes of aiding,
pact-broker
starts fine, and indeed the following curl to the assigned ports also works fine: