From 258baf76cfaaf238fc472187b6f0ec0ed7b00b45 Mon Sep 17 00:00:00 2001 From: kusu Date: Fri, 2 Mar 2018 18:26:47 +0900 Subject: [PATCH 1/2] Change components links to netwokrs --- README.md | 2 +- docker-compose.yml | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 09a348e..4732f9c 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Master/Slave Postgres Replication in 30 seconds. - * Quickstart: `docker-compose up` + * Quickstart: `docker network create pg-replication`, `docker-compose up` * For production, use docker-compose, Kubernetes, Rancher, Tutum, other PaaS tooling, ... or roll your own. * To see container environment variable requirements, see `docker-compose.yml`. * To demonstrate multiple slaves: diff --git a/docker-compose.yml b/docker-compose.yml index 81a66da..3da75eb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,5 @@ -version: '2' +version: '3' services: pg-master: @@ -14,6 +14,8 @@ services: - '/var/lib/postgresql/data' expose: - '5432' + networks: + - pg-replication pg-slave: build: '.' @@ -28,5 +30,8 @@ services: - '/var/lib/postgresql/data' expose: - '5432' - links: - - 'pg-master' + networks: + - pg-replication +networks: + pg-replication: + external: true From 4d7cc0fe58b1d2046d24ebc24051ec4087595781 Mon Sep 17 00:00:00 2001 From: "t.kusumoto" Date: Tue, 13 Mar 2018 10:41:37 +0900 Subject: [PATCH 2/2] Modify readme There's actually no need to create an external network as docker-compose creates one by default and all of the services defined in the compose file are connected to it automatically. by uLan08 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4732f9c..09a348e 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Master/Slave Postgres Replication in 30 seconds. - * Quickstart: `docker network create pg-replication`, `docker-compose up` + * Quickstart: `docker-compose up` * For production, use docker-compose, Kubernetes, Rancher, Tutum, other PaaS tooling, ... or roll your own. * To see container environment variable requirements, see `docker-compose.yml`. * To demonstrate multiple slaves: