Skip to content

Commit

Permalink
example(docker): update compose example with non-HTTPs endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
mefellows committed Oct 8, 2018
1 parent 1836c1d commit 5b0ebca
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
18 changes: 11 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
version: '3'
version: "3"

services:

postgres:
image: postgres
healthcheck:
Expand All @@ -15,22 +14,27 @@ services:

broker_app:
image: dius/pact-broker
ports:
- "80:80"
links:
- postgres
# If you remove nginx, enable the following
#ports:
# - "80:80"
environment:
PACT_BROKER_DATABASE_USERNAME: postgres
PACT_BROKER_DATABASE_PASSWORD: password
PACT_BROKER_DATABASE_HOST: postgres
PACT_BROKER_DATABASE_NAME: postgres

# 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
links:
- broker_app:broker
volumes:
- ./ssl/nginx.conf:/etc/nginx/conf.d/default.conf:ro
- ./ssl:/etc/nginx/ssl
- ./ssl/nginx.conf:/etc/nginx/conf.d/default.conf:ro
- ./ssl:/etc/nginx/ssl
ports:
- "8443:443"
- "8443:443"
- "80:80"
11 changes: 11 additions & 0 deletions ssl/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,14 @@ server {
proxy_set_header X-Real-IP $remote_addr;
}
}

server {
listen 80 default_server;
server_name localhost;

location / {
proxy_pass http://broker:80;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}

0 comments on commit 5b0ebca

Please sign in to comment.