comparison backend/doc/schema/Dockerfile @ 8817:8927ec8a3c32

Add demodata and fix server startup in DB Dockerfile.
author Tom Gottfried <tom@intevation.de>
date Wed, 10 May 2017 12:09:14 +0200
parents 13d5b6c67cef
children
comparison
equal deleted inserted replaced
8816:f5e126739c36 8817:8927ec8a3c32
23 23
24 # 24 #
25 # Install packages 25 # Install packages
26 # 26 #
27 RUN apt-get update && \ 27 RUN apt-get update && \
28 apt-get install -y postgresql-9.4-postgis-2.1 postgis 28 apt-get install -y postgresql-9.4-postgis-2.1 postgis curl
29 29
30 # 30 #
31 # Use user postgres to run the next commands 31 # Use user postgres to run the next commands
32 # 32 #
33 USER postgres 33 USER postgres
40 # database are possible. 40 # database are possible.
41 # 41 #
42 RUN echo "host all all 0.0.0.0/0 md5" >> \ 42 RUN echo "host all all 0.0.0.0/0 md5" >> \
43 /etc/postgresql/9.4/main/pg_hba.conf 43 /etc/postgresql/9.4/main/pg_hba.conf
44 44
45 RUN echo "listen_addresses='*'" >> /etc/postgresql/9.4/main/postgresql.conf 45 ENV PGCONF /etc/postgresql/9.4/main/postgresql.conf
46 RUN echo "listen_addresses='*'" >> $PGCONF
46 47
47 # 48 #
48 # Expose the PostgreSQL port 49 # Expose the PostgreSQL port
49 # 50 #
50 EXPOSE 5432 51 EXPOSE 5432
56 # 'FATAL: the database system is starting up'. 57 # 'FATAL: the database system is starting up'.
57 # It's because of the -w 58 # It's because of the -w
58 # 59 #
59 ADD . /opt/d4eriver_db 60 ADD . /opt/d4eriver_db
60 61
61 RUN /usr/lib/postgresql/9.4/bin/pg_ctl start -wD /etc/postgresql/9.4/main/ && \ 62 # Go to postgres home for write permissions
62 /opt/d4eriver_db/postgresql-setup.sh 63 WORKDIR /var/lib/postgresql
64 ENV DATA_ARCH demodaten_3.1.10-bis-3.2.x.tar.gz
65 RUN curl -k "https://wald.intevation.org/frs/download.php/2282/$DATA_ARCH" | \
66 tar xz
67
68 ENV PGDATA /var/lib/postgresql/9.4/main
69 RUN /usr/lib/postgresql/9.4/bin/pg_ctl start -wo "--config_file=$PGCONF" && \
70 /opt/d4eriver_db/postgresql-setup.sh && \
71 psql -f demodaten/d4e_demodata.dump.sql d4e && \
72 createuser -S -D -R seddb && \
73 createdb seddb && \
74 psql -f demodaten/seddb_demodata.dump.sql seddb && \
75 /usr/lib/postgresql/9.4/bin/pg_ctl stop
63 76
64 # 77 #
65 # Set the default command to run when starting the container 78 # Set the default command to run when starting the container
66 # 79 #
67 CMD ["/usr/lib/postgresql/9.4/bin/postgres", "-D", \ 80 CMD ["/usr/lib/postgresql/9.4/bin/postgres", "-D", \

http://dive4elements.wald.intevation.org