1
0
Fork 0

Fix postres-hstore build

This commit is contained in:
Piotr Dobrowolski 2017-12-13 20:02:16 +01:00
parent 339de35020
commit 0f6fe5002d
3 changed files with 6 additions and 3 deletions

View File

@ -5,6 +5,6 @@ WORKDIR /code
RUN apt-get -y update RUN apt-get -y update
RUN apt-get -y install libsasl2-dev libldap2-dev libssl-dev RUN apt-get -y install libsasl2-dev libldap2-dev libssl-dev
ADD requirements.txt /code/ 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 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/ ADD . /code/

View File

@ -1,3 +1,3 @@
FROM postgres:latest FROM postgres:latest
MAINTAINER Piotr Dobrowolski 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

View File

@ -1,9 +1,12 @@
#!/bin/bash
set -e
# Because both template1 and the user postgres database have already been created, # 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. # 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 # Running CREATE EXTENSION in both template1 and postgres can lead to
# the extensions having different eid's. # the extensions having different eid's.
psql --dbname template1 <<EOSQL psql --dbname template1 -U postgres <<EOSQL
CREATE EXTENSION hstore; CREATE EXTENSION hstore;
CREATE EXTENSION ltree; CREATE EXTENSION ltree;
DROP DATABASE $POSTGRES_USER; DROP DATABASE $POSTGRES_USER;