Mercurial > gemma
annotate docker/Dockerfile.db @ 3678:8f58851927c0
client: make layer factory only return new layer config for individual maps
instead of each time it is invoked. The purpose of the factory was to support multiple maps with individual layers.
But returning a new config each time it is invoked leads to bugs that rely on the layer's state. Now this factory
reuses the same objects it created before, per map.
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Mon, 17 Jun 2019 17:31:35 +0200 |
parents | a6f18b3ccab1 |
children | 3fc3f1ed8531 |
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 |
1577 | 6 ENV DEBIAN_FRONTEND noninteractive |
7 | |
1108
5adee8b0e29f
Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents:
524
diff
changeset
|
8 RUN apt-get update &&\ |
1577 | 9 apt-get -y install --no-install-recommends curl ca-certificates gnupg |
1108
5adee8b0e29f
Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents:
524
diff
changeset
|
10 |
5adee8b0e29f
Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents:
524
diff
changeset
|
11 # 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
|
12 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
|
13 >> /etc/apt/sources.list &&\ |
5adee8b0e29f
Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents:
524
diff
changeset
|
14 curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | \ |
1577 | 15 apt-key add - &&\ |
1108
5adee8b0e29f
Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents:
524
diff
changeset
|
16 apt-get update &&\ |
5adee8b0e29f
Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents:
524
diff
changeset
|
17 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
|
18 |
35
62e14b4d25fc
First working draft of schema for bottlenecks.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
19 USER postgres |
1108
5adee8b0e29f
Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents:
524
diff
changeset
|
20 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
|
21 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
|
22 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
|
23 |
1108
5adee8b0e29f
Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents:
524
diff
changeset
|
24 RUN \ |
5adee8b0e29f
Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents:
524
diff
changeset
|
25 # 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
|
26 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
|
27 >> /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
|
28 echo "listen_addresses='*'" >> $PGCONF &&\ |
1108
5adee8b0e29f
Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents:
524
diff
changeset
|
29 # Set port to standard value |
5adee8b0e29f
Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents:
524
diff
changeset
|
30 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
|
31 # 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
|
32 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
|
33 |
35
62e14b4d25fc
First working draft of schema for bottlenecks.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
34 # Expose the PostgreSQL port |
62e14b4d25fc
First working draft of schema for bottlenecks.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
35 EXPOSE 5432 |
62e14b4d25fc
First working draft of schema for bottlenecks.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
36 |
116
dad6cf39691e
Renamed remaining wamos stuff to gemma.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
113
diff
changeset
|
37 # 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
|
38 WORKDIR /opt/gemma |
524
156a805941b5
Move docker stuff from schema to dedicated docker directory
Tom Gottfried <tom@intevation.de>
parents:
478
diff
changeset
|
39 COPY schema/*.sql schema/*.sh ./ |
156a805941b5
Move docker stuff from schema to dedicated docker directory
Tom Gottfried <tom@intevation.de>
parents:
478
diff
changeset
|
40 COPY schema/demo-data ./demo-data/ |
35
62e14b4d25fc
First working draft of schema for bottlenecks.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
41 RUN $PGBIN/pg_ctl start -wo "--config_file=$PGCONF" && \ |
2236
32441ac04c7c
Reverted accidentally updated Dockerfiles.
Bjoern Schilberg <bjoern@intevation.de>
parents:
2235
diff
changeset
|
42 ./install-db.sh --demo --metapw "geo2Serv" && \ |
35
62e14b4d25fc
First working draft of schema for bottlenecks.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
43 $PGBIN/pg_ctl stop -m smart |
62e14b4d25fc
First working draft of schema for bottlenecks.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
44 |
62e14b4d25fc
First working draft of schema for bottlenecks.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
45 # 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
|
46 CMD ["/usr/lib/postgresql/11/bin/postgres", "-D", "/etc/postgresql/11/main"] |