annotate docker/Dockerfile.db @ 1356:ce24990b3d5c

add licensing hint to docker files * Use LABEL to add a description to the docker images that hints towards the use of gemma and gives the url of the current repo. * Fixes a markdown formatto in the README.md.
author Bernhard Reiter <bernhard@intevation.de>
date Mon, 26 Nov 2018 16:12:09 +0100
parents 5adee8b0e29f
children 8ed3a8fd2d2f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1108
5adee8b0e29f Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents: 524
diff changeset
1 FROM ubuntu:bionic
157
a85c44438d48 fix: Replaced MAINTAINER by LABEL
Thomas Junk <thomas.junk@intevation.de>
parents: 156
diff changeset
2 LABEL authors="tom.gottfried@intevation.de"
1356
ce24990b3d5c add licensing hint to docker files
Bernhard Reiter <bernhard@intevation.de>
parents: 1108
diff changeset
3 LABEL description="Contains software from gemma, for right holders and\
ce24990b3d5c add licensing hint to docker files
Bernhard Reiter <bernhard@intevation.de>
parents: 1108
diff changeset
4 licensing infos, see https://hg.intevation.de/gemma ."
35
62e14b4d25fc First working draft of schema for bottlenecks.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
5
1108
5adee8b0e29f Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents: 524
diff changeset
6 RUN apt-get update &&\
5adee8b0e29f Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents: 524
diff changeset
7 apt-get -y install --no-install-recommends curl gnupg
5adee8b0e29f Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents: 524
diff changeset
8
5adee8b0e29f Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents: 524
diff changeset
9 # Add PostgreSQL's repository for current PostgreSQL release and extensions:
5adee8b0e29f Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents: 524
diff changeset
10 RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main' \
5adee8b0e29f Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents: 524
diff changeset
11 >> /etc/apt/sources.list &&\
5adee8b0e29f Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents: 524
diff changeset
12 curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | \
5adee8b0e29f Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents: 524
diff changeset
13 sudo apt-key add - &&\
5adee8b0e29f Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents: 524
diff changeset
14 apt-get update &&\
5adee8b0e29f Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents: 524
diff changeset
15 apt-get -y install postgresql-11-postgis-2.5 postgresql-11-pgtap
5adee8b0e29f Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents: 524
diff changeset
16
35
62e14b4d25fc First working draft of schema for bottlenecks.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
17 USER postgres
1108
5adee8b0e29f Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents: 524
diff changeset
18 ENV PGBIN /usr/lib/postgresql/11/bin
5adee8b0e29f Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents: 524
diff changeset
19 ENV PGDATA /var/lib/postgresql/11/main
5adee8b0e29f Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents: 524
diff changeset
20 ENV PGCONF /etc/postgresql/11/main/postgresql.conf
35
62e14b4d25fc First working draft of schema for bottlenecks.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
21
1108
5adee8b0e29f Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents: 524
diff changeset
22 RUN \
5adee8b0e29f Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents: 524
diff changeset
23 # Adjust PostgreSQL configuration to allow remote connections
5adee8b0e29f Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents: 524
diff changeset
24 echo "host all all 0.0.0.0/0 md5" \
5adee8b0e29f Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents: 524
diff changeset
25 >> /etc/postgresql/11/main/pg_hba.conf &&\
306
70592a18c5c6 Keep log on stderr to be able to use docker logs
Tom Gottfried <tom@intevation.de>
parents: 246
diff changeset
26 echo "listen_addresses='*'" >> $PGCONF &&\
1108
5adee8b0e29f Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents: 524
diff changeset
27 # Set port to standard value
5adee8b0e29f Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents: 524
diff changeset
28 sed -i '/port/s/543./5432/' $PGCONF &&\
306
70592a18c5c6 Keep log on stderr to be able to use docker logs
Tom Gottfried <tom@intevation.de>
parents: 246
diff changeset
29 # Keep log on stderr to be able to use docker logs
70592a18c5c6 Keep log on stderr to be able to use docker logs
Tom Gottfried <tom@intevation.de>
parents: 246
diff changeset
30 sed -i '/logging_collector/s/on/off/' $PGCONF
1108
5adee8b0e29f Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents: 524
diff changeset
31
35
62e14b4d25fc First working draft of schema for bottlenecks.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
32 # Expose the PostgreSQL port
62e14b4d25fc First working draft of schema for bottlenecks.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
33 EXPOSE 5432
62e14b4d25fc First working draft of schema for bottlenecks.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
34
116
dad6cf39691e Renamed remaining wamos stuff to gemma.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 113
diff changeset
35 # Create GEMMA role and database
173
2b04de578be0 Use COPY in a way that allows replacing by a volume
Tom Gottfried <tom@intevation.de>
parents: 172
diff changeset
36 WORKDIR /opt/gemma
524
156a805941b5 Move docker stuff from schema to dedicated docker directory
Tom Gottfried <tom@intevation.de>
parents: 478
diff changeset
37 COPY schema/*.sql schema/*.sh ./
156a805941b5 Move docker stuff from schema to dedicated docker directory
Tom Gottfried <tom@intevation.de>
parents: 478
diff changeset
38 COPY schema/demo-data ./demo-data/
35
62e14b4d25fc First working draft of schema for bottlenecks.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
39 RUN $PGBIN/pg_ctl start -wo "--config_file=$PGCONF" && \
478
3af7ca761f6a Purge password reset role
Tom Gottfried <tom@intevation.de>
parents: 463
diff changeset
40 ./install-db.sh --demo --metapw "geo2Serv" && \
35
62e14b4d25fc First working draft of schema for bottlenecks.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
41 $PGBIN/pg_ctl stop -m smart
62e14b4d25fc First working draft of schema for bottlenecks.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
42
62e14b4d25fc First working draft of schema for bottlenecks.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
43 # Set the default command to run when starting the container
1108
5adee8b0e29f Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents: 524
diff changeset
44 CMD ["/usr/lib/postgresql/11/bin/postgres", "-D", "/etc/postgresql/11/main"]