-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added broker + postgres as docker-compose
- Loading branch information
Showing
5 changed files
with
94 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FROM postgres:9.5.3 | ||
MAINTAINER Oliver Nautsch | ||
ADD db-dump.sql / | ||
ADD docker-entrypoint-initdb.d/*.sh /docker-entrypoint-initdb.d/ |
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,28 @@ | ||
SET default_transaction_read_only = off; | ||
|
||
SET client_encoding = 'UTF8'; | ||
SET standard_conforming_strings = on; | ||
|
||
-- | ||
-- Drop databases | ||
-- | ||
DROP DATABASE IF EXISTS broker; | ||
|
||
-- | ||
-- Drop roles | ||
-- | ||
DROP ROLE IF EXISTS broker; | ||
|
||
-- | ||
-- Roles | ||
-- | ||
CREATE ROLE broker; | ||
ALTER ROLE broker WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'md50890f0db0b9da90a6dab40d41dff1f59'; -- pw: broker123 | ||
|
||
-- | ||
-- Database creation | ||
-- | ||
CREATE DATABASE broker WITH TEMPLATE = template0 OWNER = broker; | ||
GRANT ALL ON DATABASE broker TO broker; | ||
|
||
|
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,5 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
psql --username "$POSTGRES_USER" -f /db-dump.sql | ||
|
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,55 @@ | ||
version: '2' | ||
|
||
volumes: | ||
db-data: | ||
|
||
networks: | ||
nautsch.net: | ||
|
||
services: | ||
nginxedge: | ||
image: jwilder/nginx-proxy | ||
container_name: nginx-edge | ||
ports: | ||
- "80:80" | ||
- "443:443" | ||
volumes: | ||
- "/var/run/docker.sock:/tmp/docker.sock:ro" | ||
- "./nginxedge/my_proxy.conf:/etc/nginx/conf.d/my_proxy.conf:ro" | ||
networks: | ||
nautsch.net: | ||
restart: always | ||
broker: | ||
image: dius/pact_broker | ||
container_name: broker | ||
environment: | ||
- PACT_BROKER_DATABASE_USERNAME=broker | ||
- PACT_BROKER_DATABASE_PASSWORD=broker123 | ||
- PACT_BROKER_DATABASE_HOST=db.nautsch.net | ||
- PACT_BROKER_DATABASE_NAME=broker | ||
- VIRTUAL_HOST=broker.nautsch.net | ||
- VIRTUAL_PORT=80 | ||
networks: | ||
nautsch.net: | ||
aliases: | ||
- broker.nautsch.net | ||
links: | ||
- db | ||
db: | ||
build: | ||
context: ./db | ||
container_name: db | ||
hostname: db | ||
ports: | ||
- "5432:5432" | ||
environment: | ||
- POSTGRES_PASSWORD=admin123 | ||
- POSTGRES_USER=admin | ||
- PGDATA=/var/lib/postgresql/data/pgdata | ||
volumes: | ||
- db-data:/var/lib/postgresql/data/pgdata | ||
networks: | ||
nautsch.net: | ||
aliases: | ||
- db.nautsch.net | ||
restart: always |
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,2 @@ | ||
server_tokens off; | ||
client_max_body_size 0; |