comparison Dockerfile @ 35:62e14b4d25fc

First working draft of schema for bottlenecks.
author Tom Gottfried <tom@intevation.de>
date Thu, 03 May 2018 18:08:07 +0200
parents
children 333c42e341e5
comparison
equal deleted inserted replaced
-1:000000000000 35:62e14b4d25fc
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
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 wamos.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 $PGBIN/pg_ctl stop -m smart
39
40 # Set the default command to run when starting the container
41 CMD ["/usr/pgsql-10/bin/postgres", "-D", "/var/lib/pgsql/10/data"]
42
43 # Build with e.g.:
44 # docker build -t wamos .
45
46 # Get a running instance with e.g.:
47 # docker run --name wamos -d -p 54321:5432 wamos