# HG changeset patch # User Thomas Junk # Date 1530610816 -7200 # Node ID 4ade330e571eb91e4ea1c4eda4e565a3fdb7270f # Parent 399357bc205e7ab593dc2482503bfa28a301803c refactor: Refactor Dockerfile to reflect changes Tighten the run commands to streamline container build Include actual demousers. diff -r 399357bc205e -r 4ade330e571e schema/Dockerfile --- a/schema/Dockerfile Mon Jul 02 18:07:02 2018 +0200 +++ b/schema/Dockerfile Tue Jul 03 11:40:16 2018 +0200 @@ -2,40 +2,38 @@ MAINTAINER tom.gottfried@intevation.de # Add the PostgreSQL PGP key to verify the official yum repository packages -RUN rpm --import https://yum.postgresql.org/RPM-GPG-KEY-PGDG-10 - +RUN rpm --import https://yum.postgresql.org/RPM-GPG-KEY-PGDG-10 &&\ # Add PostgreSQL's repository. It contains the most recent release # of PostgreSQL, 10: -RUN yum -q -y install https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm - + yum -q -y install https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm &&\ # Install PostgreSQL 10 and PostGIS -RUN yum -q -y install postgresql10-server -RUN yum -q -y install epel-release -RUN yum -q -y install postgis24_10 pgtap10 - + yum -q -y install postgresql10-server &&\ + yum -q -y install epel-release &&\ + yum -q -y install postgis24_10 pgtap10 USER postgres ENV PGBIN /usr/pgsql-10/bin/ # initdb PostgreSQL 10: ENV PGDATA /var/lib/pgsql/10/data -RUN $PGBIN/initdb -E UTF8 2>&1 < /dev/null - +ENV PGCONF /var/lib/pgsql/10/data/postgresql.conf +RUN $PGBIN/initdb -E UTF8 2>&1 < /dev/null &&\ # Adjust PostgreSQL configuration so that remote connections to the # database are possible. -ENV PGCONF /var/lib/pgsql/10/data/postgresql.conf -RUN echo "host all all 0.0.0.0/0 md5" >> /var/lib/pgsql/10/data/pg_hba.conf -RUN echo "listen_addresses='*'" >> $PGCONF - + echo "host all all 0.0.0.0/0 md5" >> /var/lib/pgsql/10/data/pg_hba.conf &&\ + echo "listen_addresses='*'" >> $PGCONF # Expose the PostgreSQL port EXPOSE 5432 # Create GEMMA role and database -ADD *.sql ./ +COPY *.sql ./ +COPY demo-data/*.sql ./ RUN $PGBIN/pg_ctl start -wo "--config_file=$PGCONF" && \ psql -c "CREATE USER gemma PASSWORD 'gemma'" && \ createdb gemma && \ psql -f gemma.sql -d gemma && \ psql -f auth.sql -d gemma && \ + psql -f users.sql -d gemma && \ + psql -f responsibility_areas.sql -d gemma && \ $PGBIN/pg_ctl stop -m smart # Set the default command to run when starting the container