From 321d8a863d7d6e58dc7815f2150f1b5c79f96d7d Mon Sep 17 00:00:00 2001 From: kev Date: Wed, 7 Dec 2016 09:35:42 +0800 Subject: [PATCH] add postgres --- README.md | 1 + postgres/README.md | 33 +++++++++++++++++++++++++++++++++ postgres/docker-compose.yml | 11 +++++++++++ 3 files changed, 45 insertions(+) create mode 100644 postgres/README.md create mode 100644 postgres/docker-compose.yml diff --git a/README.md b/README.md index 9cd7b21..f7d6b59 100644 --- a/README.md +++ b/README.md @@ -238,6 +238,7 @@ A collection of delicious docker recipes. - [x] neo4j - [x] owncloud - [x] phpmyadmin +- [x] postgres - [x] registry - [x] rocket.chat - [x] scrapinghub/splash diff --git a/postgres/README.md b/postgres/README.md new file mode 100644 index 0000000..7c06021 --- /dev/null +++ b/postgres/README.md @@ -0,0 +1,33 @@ +postgres +======== + +![](https://www.postgresql.org/media/img/docs/hdr_logo.png) + +## docker-compose.yml + +```yaml +postgres: + image: postgres:alpine + ports: + - "5432:5432" + environment: + - POSTGRES_USER=root + - POSTGRES_PASSWORD=root + - POSTGRES_DB=postgres + restart: always +``` + +## up and running + +```bash +$ docker-compose up -d + +$ docker-compose exec postgres psql postgres +>>> SELECT CURRENT_TIMESTAMP; + now +------------------------------- + 2016-12-07 01:44:29.872928+00 +(1 row) + +>>> \q +``` diff --git a/postgres/docker-compose.yml b/postgres/docker-compose.yml new file mode 100644 index 0000000..ab56159 --- /dev/null +++ b/postgres/docker-compose.yml @@ -0,0 +1,11 @@ +postgres: + image: postgres:alpine + ports: + - "5432:5432" + volumes: + - ./data:/var/lib/postgresql/data + environment: + - POSTGRES_USER=root + - POSTGRES_PASSWORD=root + - POSTGRES_DB=postgres + restart: always