-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow the env var used to set the port to be called a different…
… name to support running on Heroku
- Loading branch information
Showing
8 changed files
with
97 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
version: "3" | ||
|
||
services: | ||
postgres: | ||
image: postgres | ||
healthcheck: | ||
test: psql postgres --command "select 1" -U postgres | ||
ports: | ||
- "5432:5432" | ||
# volumes: | ||
# - postgres-volume:/var/lib/postgresql/data | ||
environment: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: password | ||
POSTGRES_DB: postgres | ||
|
||
pact-broker: | ||
# image: pactfoundation/pact-broker | ||
build: . | ||
ports: | ||
- "9393:9393" | ||
depends_on: | ||
- postgres | ||
environment: | ||
PACT_BROKER_PORT_ENVIRONMENT_VARIABLE_NAME: PORT | ||
PACT_BROKER_DATABASE_URL_ENVIRONMENT_VARIABLE_NAME: DATABASE_URL | ||
DATABASE_URL: "postgres://postgres:password@postgres/postgres" | ||
# PACT_BROKER_DATABASE_USERNAME: postgres | ||
# PACT_BROKER_DATABASE_PASSWORD: password | ||
# PACT_BROKER_DATABASE_HOST: postgres | ||
# PACT_BROKER_DATABASE_NAME: postgres | ||
# PACT_BROKER_PORT: "9292" | ||
PORT: '9393' | ||
PACT_BROKER_LOG_LEVEL: INFO | ||
PACT_BROKER_SQL_LOG_LEVEL: DEBUG | ||
|
||
# Nginx is not necessary, but demonstrates how | ||
# one might use a reverse proxy in front of the broker, | ||
# and includes the use of a self-signed TLS certificate | ||
nginx: | ||
image: nginx:alpine | ||
depends_on: | ||
- pact-broker | ||
volumes: | ||
- ./ssl/nginx.conf:/etc/nginx/conf.d/default.conf:ro | ||
- ./ssl:/etc/nginx/ssl | ||
ports: | ||
- "8443:443" | ||
- "80:80" | ||
volumes: | ||
postgres-volume: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# This example demonstrates how you can run the Pact Broker docker image on Heroku | ||
# by allowing the PORT and DATABASE_URL environment variables to be used instead of | ||
# PACT_BROKER_PORT and PACT_BROKER_DATABASE_URL. | ||
|
||
version: "3" | ||
|
||
services: | ||
postgres: | ||
image: postgres | ||
healthcheck: | ||
test: psql postgres --command "select 1" -U postgres | ||
ports: | ||
- "5432:5432" | ||
environment: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: password | ||
POSTGRES_DB: postgres | ||
|
||
pact-broker: | ||
image: pactfoundation/pact-broker | ||
ports: | ||
- "9393:9393" | ||
depends_on: | ||
- postgres | ||
environment: | ||
PACT_BROKER_PORT_ENVIRONMENT_VARIABLE_NAME: "PORT" | ||
PORT: "9393" | ||
PACT_BROKER_DATABASE_URL_ENVIRONMENT_VARIABLE_NAME: "DATABASE_URL" | ||
DATABASE_URL: "postgres://postgres:password@postgres/postgres" | ||
PACT_BROKER_LOG_LEVEL: INFO | ||
PACT_BROKER_SQL_LOG_LEVEL: DEBUG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
port ENV[ENV['PACT_BROKER_PORT_ENVIRONMENT_VARIABLE_NAME']] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/bin/sh | ||
|
||
bundle exec puma --port $PACT_BROKER_PORT | ||
bundle exec puma |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters