Mercurial > gemma
annotate docker/Dockerfile.db @ 1290:ad528ad130d6
staging area: basic layout and selectionlogic
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Thu, 22 Nov 2018 13:10:22 +0100 |
parents | 5adee8b0e29f |
children | ce24990b3d5c |
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" |
35
62e14b4d25fc
First working draft of schema for bottlenecks.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
3 |
1108
5adee8b0e29f
Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents:
524
diff
changeset
|
4 RUN apt-get update &&\ |
5adee8b0e29f
Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents:
524
diff
changeset
|
5 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
|
6 |
5adee8b0e29f
Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents:
524
diff
changeset
|
7 # 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
|
8 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
|
9 >> /etc/apt/sources.list &&\ |
5adee8b0e29f
Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents:
524
diff
changeset
|
10 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
|
11 sudo apt-key add - &&\ |
5adee8b0e29f
Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents:
524
diff
changeset
|
12 apt-get update &&\ |
5adee8b0e29f
Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents:
524
diff
changeset
|
13 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
|
14 |
35
62e14b4d25fc
First working draft of schema for bottlenecks.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
15 USER postgres |
1108
5adee8b0e29f
Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents:
524
diff
changeset
|
16 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
|
17 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
|
18 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
|
19 |
1108
5adee8b0e29f
Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents:
524
diff
changeset
|
20 RUN \ |
5adee8b0e29f
Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents:
524
diff
changeset
|
21 # 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
|
22 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
|
23 >> /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
|
24 echo "listen_addresses='*'" >> $PGCONF &&\ |
1108
5adee8b0e29f
Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents:
524
diff
changeset
|
25 # Set port to standard value |
5adee8b0e29f
Migrate database Dockerfile to bionic and upgrade database
Tom Gottfried <tom@intevation.de>
parents:
524
diff
changeset
|
26 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
|
27 # 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
|
28 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
|
29 |
35
62e14b4d25fc
First working draft of schema for bottlenecks.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
30 # Expose the PostgreSQL port |
62e14b4d25fc
First working draft of schema for bottlenecks.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
31 EXPOSE 5432 |
62e14b4d25fc
First working draft of schema for bottlenecks.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
32 |
116
dad6cf39691e
Renamed remaining wamos stuff to gemma.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
113
diff
changeset
|
33 # 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
|
34 WORKDIR /opt/gemma |
524
156a805941b5
Move docker stuff from schema to dedicated docker directory
Tom Gottfried <tom@intevation.de>
parents:
478
diff
changeset
|
35 COPY schema/*.sql schema/*.sh ./ |
156a805941b5
Move docker stuff from schema to dedicated docker directory
Tom Gottfried <tom@intevation.de>
parents:
478
diff
changeset
|
36 COPY schema/demo-data ./demo-data/ |
35
62e14b4d25fc
First working draft of schema for bottlenecks.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
37 RUN $PGBIN/pg_ctl start -wo "--config_file=$PGCONF" && \ |
478
3af7ca761f6a
Purge password reset role
Tom Gottfried <tom@intevation.de>
parents:
463
diff
changeset
|
38 ./install-db.sh --demo --metapw "geo2Serv" && \ |
35
62e14b4d25fc
First working draft of schema for bottlenecks.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
39 $PGBIN/pg_ctl stop -m smart |
62e14b4d25fc
First working draft of schema for bottlenecks.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
40 |
62e14b4d25fc
First working draft of schema for bottlenecks.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
41 # 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
|
42 CMD ["/usr/lib/postgresql/11/bin/postgres", "-D", "/etc/postgresql/11/main"] |