summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPiotr Dobrowolski <admin@tastycode.pl>2017-12-13 20:02:16 +0100
committerPiotr Dobrowolski <admin@tastycode.pl>2017-12-13 20:02:16 +0100
commit0f6fe5002d10af2ba1fcdf61377906591bac5225 (patch)
tree542a2250de8ea7a48b3919b578383e07242b75d9
parent339de3502053d601e0d7961c96c8909754fdac85 (diff)
downloadspejstore-0f6fe5002d10af2ba1fcdf61377906591bac5225.tar.gz
spejstore-0f6fe5002d10af2ba1fcdf61377906591bac5225.tar.bz2
spejstore-0f6fe5002d10af2ba1fcdf61377906591bac5225.zip
Fix postres-hstore build
-rw-r--r--Dockerfile2
-rw-r--r--postgres-hstore/Dockerfile2
-rw-r--r--postgres-hstore/create_extension.sh5
3 files changed, 6 insertions, 3 deletions
diff --git a/Dockerfile b/Dockerfile
index a313bec..87fb994 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -5,6 +5,6 @@ WORKDIR /code
RUN apt-get -y update
RUN apt-get -y install libsasl2-dev libldap2-dev libssl-dev
ADD requirements.txt /code/
-RUN pip install -r requirements.txt
+RUN pip install --no-cache-dir -r requirements.txt
RUN wget https://github.com/vishnubob/wait-for-it/raw/8ed92e8cab83cfed76ff012ed4a36cef74b28096/wait-for-it.sh -O /usr/local/bin/wait-for-it && chmod +x /usr/local/bin/wait-for-it
ADD . /code/
diff --git a/postgres-hstore/Dockerfile b/postgres-hstore/Dockerfile
index 14e4514..cb97d3d 100644
--- a/postgres-hstore/Dockerfile
+++ b/postgres-hstore/Dockerfile
@@ -1,3 +1,3 @@
FROM postgres:latest
MAINTAINER Piotr Dobrowolski
-ADD create_extension.sh docker-entrypoint-initdb.d/create_extension.sh
+ADD create_extension.sh /docker-entrypoint-initdb.d/create_extension.sh
diff --git a/postgres-hstore/create_extension.sh b/postgres-hstore/create_extension.sh
index f28bdbe..60576f8 100644
--- a/postgres-hstore/create_extension.sh
+++ b/postgres-hstore/create_extension.sh
@@ -1,9 +1,12 @@
+#!/bin/bash
+set -e
+
# Because both template1 and the user postgres database have already been created,
# we need to create the hstore extension in template1 and then recreate the postgres database.
#
# Running CREATE EXTENSION in both template1 and postgres can lead to
# the extensions having different eid's.
-psql --dbname template1 <<EOSQL
+psql --dbname template1 -U postgres <<EOSQL
CREATE EXTENSION hstore;
CREATE EXTENSION ltree;
DROP DATABASE $POSTGRES_USER;