Commit 3898a941 authored by Guillaume Mella's avatar Guillaume Mella

bump to postgres:12 as root image for cleanup and better deployement steps

parent 2ed83f5e
FROM chbrandt/dachs:postgres
FROM postgres:12
# https://hub.docker.com/_/postgres
# start from V12 since debian version uses buster and provides pgsphere in the distribution
ENV SQL_FILES oidb.sql tap_schema.sql oidb_tap_schema.sql oidb_datalink.sql oidb_datalink_tap_schema.sql
WORKDIR /tmp
RUN for s in $SQL_FILES ; do wget https://svn.jmmc.fr/jmmc-web/trunk/exist/oidb/conf/$s ; done
RUN apt-get update && apt-get install -y postgresql-pgsphere curl
RUN PGDATA=/var/lib/postgresql/${PG_VERSION} \
mkdir -p -m 777 /var/run/postgresql/${PG_VERSION}-main.pg_stat_tmp/ && \
su - postgres -c "/usr/lib/postgresql/${PG_VERSION}/bin/postgres \
-c config_file=/etc/postgresql/${PG_VERSION}/main/postgresql.conf \
-c logging_collector=on" & \
for i in $(seq 20); do if pg_isready -q ; then break; else sleep $i ; fi; done && \
su postgres -c "createuser -s oidb" && \
su postgres -c "createdb oidb" && \
for s in $SQL_FILES ; do echo "processing $s ..." ; su postgres -c "psql oidb < $s"; done
ENV POSTGRES_USER oidb
ENV POSTGRES_DB oidb
RUN sed -i "s@172.17.0.0/24@172.16.0.0/12@g" /etc/postgresql/${PG_VERSION}/main/pg_hba.conf
CMD ["/bin/bash", "--rcfile", "/dachs.sh"]
ENV SQL_FILES oidb.sql tap_schema.sql oidb_tap_schema.sql oidb_datalink.sql oidb_datalink_tap_schema.sql
RUN for s in $SQL_FILES ; do curl https://svn.jmmc.fr/jmmc-web/trunk/exist/oidb/conf/$s >> /docker-entrypoint-initdb.d/oidb-init-merged.sql ; done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment