From 5d7a9fa16b160aaf90286328f52921cef20a48f4 Mon Sep 17 00:00:00 2001 From: Jivan Amara Date: Fri, 6 Jan 2017 13:09:38 -0800 Subject: [PATCH] Since postgres only needs a single superuser, eliminate postgres init in lieu of image env vars. --- scripts/docker-dev/docker-compose.yaml | 7 +++++-- scripts/docker-dev/postgres-postgis/Dockerfile | 3 --- scripts/docker-dev/postgres-postgis/init-user-db.sh | 9 --------- 3 files changed, 5 insertions(+), 14 deletions(-) delete mode 100644 scripts/docker-dev/postgres-postgis/Dockerfile delete mode 100644 scripts/docker-dev/postgres-postgis/init-user-db.sh diff --git a/scripts/docker-dev/docker-compose.yaml b/scripts/docker-dev/docker-compose.yaml index 896ee05..8db06ad 100644 --- a/scripts/docker-dev/docker-compose.yaml +++ b/scripts/docker-dev/docker-compose.yaml @@ -1,8 +1,11 @@ version: '2' services: postgres: - build: "postgres-postgis/" - image: "postgresql-postgis:9.3-2.3" + image: mdillon/postgis:9.3 + environment: + - POSTGRES_USER=osgeo + - POSTGRES_PASSWORD=osgeo + - POSTGRES_DB=osgeo ports: - "5432:5432" expose: diff --git a/scripts/docker-dev/postgres-postgis/Dockerfile b/scripts/docker-dev/postgres-postgis/Dockerfile deleted file mode 100644 index 549bf2e..0000000 --- a/scripts/docker-dev/postgres-postgis/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -from mdillon/postgis:9.3 - -COPY init-user-db.sh /docker-entrypoint-initdb.d/init-user-db.sh diff --git a/scripts/docker-dev/postgres-postgis/init-user-db.sh b/scripts/docker-dev/postgres-postgis/init-user-db.sh deleted file mode 100644 index ae487d9..0000000 --- a/scripts/docker-dev/postgres-postgis/init-user-db.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -set -e - -psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL - CREATE USER osgeo WITH PASSWORD 'osgeo'; - ALTER USER osgeo WITH SUPERUSER; - CREATE DATABASE osgeo WITH OWNER osgeo; - GRANT ALL PRIVILEGES ON DATABASE osgeo TO osgeo; -EOSQL