view docker/Dockerfile.pg @ 5348:45b03e8ca47e extented-report

Toggles in user overview and in details section as well established This commit introduces toggles to change the state for administrative users to be able to receive the DQL Report. For quick access there is the possibility to change via overview. If you want to edit this in the details or if you change the role of the user to a non administrative, there is the possibility to change the flag in a fast way. When the user looses administrative privilege the option is not available and the according flag is set to "false". Aside: Changed user.go to resolve inconsitencies in frontend where the key "reports" was missing due to "omitempty" in marshalling the go objects.
author Thomas Junk <thomas.junk@intevation.de>
date Mon, 21 Jun 2021 16:41:39 +0200
parents 71f73df1356d
children
line wrap: on
line source

FROM ubuntu:bionic
LABEL authors="tom.gottfried@intevation.de"
LABEL description="Contains software from gemma, for right holders and\
 licensing infos, see https://hg.intevation.de/gemma ."

ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update &&\
    apt-get -y install git make gcc libreadline-dev zlib1g-dev flex bison

# Add PostgreSQL's repository
WORKDIR /opt/
RUN git clone git://git.postgresql.org/git/postgresql.git
WORKDIR /opt/postgresql
RUN git checkout REL_11_STABLE

ENV PGDATA /usr/local/pgsql/data
ENV PGBIN /usr/local/pgsql/bin
ENV PGCONF /usr/local/pgsql/data/postgresql.conf

# Install PostgreSQL from sources
RUN ./configure && make && make install

# Install PostGIS dependencies
RUN apt-get -y install autoconf xsltproc \
            libproj-dev libgeos-dev libxml2-dev libjson-c-dev libgdal-dev

# Add PostGIS repository and build it
WORKDIR /opt/
RUN git clone https://git.osgeo.org/gitea/postgis/postgis.git
WORKDIR /opt/postgis
RUN git checkout stable-2.5
RUN ./autogen.sh && ./configure --with-pgconfig=$PGBIN/pg_config && \
    make comments && make && make install

# Build btree_gist extension
WORKDIR /opt/postgresql/contrib/btree_gist
RUN make && make install

# Put PostgreSQL executables in path
ENV PATH $PGBIN:$PATH

# Add pgTAP repository and build it
WORKDIR /opt
RUN git clone https://github.com/theory/pgtap.git
WORKDIR /opt/pgtap
RUN make && make install

# Initialize cluster
RUN mkdir -p $PGDATA && useradd postgres -d $PGDATA && chown postgres $PGDATA
USER postgres
RUN $PGBIN/initdb -D $PGDATA

RUN \
    # Adjust PostgreSQL configuration to allow remote connections
    echo "host all  all    0.0.0.0/0  md5" \
         >> /usr/local/pgsql/data/pg_hba.conf &&\
    echo "listen_addresses='*'" >> $PGCONF &&\
    # Set port to standard value
    sed -i '/port/s/543./5432/' $PGCONF &&\
    # Keep log on stderr to be able to use docker logs
    sed -i '/logging_collector/s/on/off/' $PGCONF

# Expose the PostgreSQL port
EXPOSE 5432

# Create GEMMA role and database
WORKDIR /opt/gemma
COPY schema/*.sql schema/*.sh ./
COPY schema/demo-data ./demo-data/
RUN $PGBIN/pg_ctl start -wo "--config_file=$PGCONF" && \
    PATH=$PGBIN:$PATH ./install-db.sh --demo --metapw "geo2Serv" && \
    $PGBIN/pg_ctl stop -m smart

# Set the default command to run when starting the container
CMD ["/usr/local/pgsql/bin/postgres", "-D", "/usr/local/pgsql/data"]