Mercurial > gemma
comparison docker/Dockerfile.db @ 524:156a805941b5
Move docker stuff from schema to dedicated docker directory
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Mon, 27 Aug 2018 17:24:08 +0200 |
parents | schema/Dockerfile@3af7ca761f6a |
children | 5adee8b0e29f |
comparison
equal
deleted
inserted
replaced
523:e86d6e016bbb | 524:156a805941b5 |
---|---|
1 FROM centos:7 | |
2 LABEL authors="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 # Add PostgreSQL's repository. It contains the most recent release | |
7 # of PostgreSQL, 10: | |
8 yum -q -y install https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm &&\ | |
9 # Install PostgreSQL 10 and PostGIS | |
10 yum -q -y install postgresql10-server &&\ | |
11 yum -q -y install epel-release &&\ | |
12 yum -q -y install postgis24_10 pgtap10 | |
13 USER postgres | |
14 ENV PGBIN /usr/pgsql-10/bin/ | |
15 | |
16 # initdb PostgreSQL 10: | |
17 ENV PGDATA /var/lib/pgsql/10/data | |
18 ENV PGCONF /var/lib/pgsql/10/data/postgresql.conf | |
19 RUN $PGBIN/initdb -E UTF8 2>&1 < /dev/null &&\ | |
20 # Adjust PostgreSQL configuration so that remote connections to the | |
21 # database are possible. | |
22 echo "host all all 0.0.0.0/0 md5" >> /var/lib/pgsql/10/data/pg_hba.conf &&\ | |
23 echo "listen_addresses='*'" >> $PGCONF &&\ | |
24 # Keep log on stderr to be able to use docker logs | |
25 sed -i '/logging_collector/s/on/off/' $PGCONF | |
26 # Expose the PostgreSQL port | |
27 EXPOSE 5432 | |
28 | |
29 # Create GEMMA role and database | |
30 WORKDIR /opt/gemma | |
31 COPY schema/*.sql schema/*.sh ./ | |
32 COPY schema/demo-data ./demo-data/ | |
33 RUN $PGBIN/pg_ctl start -wo "--config_file=$PGCONF" && \ | |
34 ./install-db.sh --demo --metapw "geo2Serv" && \ | |
35 $PGBIN/pg_ctl stop -m smart | |
36 | |
37 # Set the default command to run when starting the container | |
38 CMD ["/usr/pgsql-10/bin/postgres", "-D", "/var/lib/pgsql/10/data"] |