comparison schema/Dockerfile @ 113:25b28fd0e256

Moved schema stuff to own subfolder.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 26 Jun 2018 16:14:59 +0200
parents Dockerfile@7f934f77831a
children dad6cf39691e
comparison
equal deleted inserted replaced
112:894f633e2d3f 113:25b28fd0e256
1 FROM centos:7
2 MAINTAINER tom.gottfried@intevation.de
3
4 # Add the PostgreSQL PGP key to verify the official yum repository packages
5 RUN rpm --import https://yum.postgresql.org/RPM-GPG-KEY-PGDG-10
6
7 # Add PostgreSQL's repository. It contains the most recent release
8 # of PostgreSQL, 10:
9 RUN yum -q -y install https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm
10
11 # Install PostgreSQL 10 and PostGIS
12 RUN yum -q -y install postgresql10-server
13 RUN yum -q -y install epel-release
14 RUN yum -q -y install postgis24_10 pgtap10
15
16 USER postgres
17 ENV PGBIN /usr/pgsql-10/bin/
18
19 # initdb PostgreSQL 10:
20 ENV PGDATA /var/lib/pgsql/10/data
21 RUN $PGBIN/initdb -E UTF8 2>&1 < /dev/null
22
23 # Adjust PostgreSQL configuration so that remote connections to the
24 # database are possible.
25 ENV PGCONF /var/lib/pgsql/10/data/postgresql.conf
26 RUN echo "host all all 0.0.0.0/0 md5" >> /var/lib/pgsql/10/data/pg_hba.conf
27 RUN echo "listen_addresses='*'" >> $PGCONF
28
29 # Expose the PostgreSQL port
30 EXPOSE 5432
31
32 # Create WAMOS role and database
33 ADD *.sql ./
34 RUN $PGBIN/pg_ctl start -wo "--config_file=$PGCONF" && \
35 psql -c "CREATE USER wamos PASSWORD 'wamos'" && \
36 createdb wamos && \
37 psql -f wamos.sql -d wamos && \
38 psql -f auth.sql -d wamos && \
39 $PGBIN/pg_ctl stop -m smart
40
41 # Set the default command to run when starting the container
42 CMD ["/usr/pgsql-10/bin/postgres", "-D", "/var/lib/pgsql/10/data"]