From ff24be233ac7b10221142675b205b347b5588fd7 Mon Sep 17 00:00:00 2001 From: startxfr Date: Mon, 30 Nov 2015 03:25:20 +0100 Subject: reshape of postgresql --- Services/postgres/Dockerfile | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'Services/postgres/Dockerfile') diff --git a/Services/postgres/Dockerfile b/Services/postgres/Dockerfile index 2af22b1..a8da28e 100644 --- a/Services/postgres/Dockerfile +++ b/Services/postgres/Dockerfile @@ -1,19 +1,22 @@ FROM startx/fedora MAINTAINER Christophe LARUE +USER root RUN dnf -y install postgresql postgresql-libs postgresql-server \ - && dnf clean all \ - && mkdir -p /var/log/pgsql /var/lib/pgsql \ - && touch /var/log/pgsql/.keep /var/lib/pgsql/.keep \ - && chown -R postgres:postgres /var/log/pgsql /var/lib/pgsql -# Copy startx toolkit -COPY sx/* /sx/ -COPY postgresql.conf /var/lib/pgsql/postgresql.conf -RUN chmod ug+rx /sx/postgres* \ - && chown -R postgres:postgres /sx/postgresql* + && dnf clean all && \ + mkdir -p /tmp/sql +ENV STARTUPLOG=/data/logs/postgresql/startup.log \ + LOG_PATH=/data/logs/postgresql \ + DATA_PATH=/data/postgresql \ + LOADSQL_PATH=/tmp/sql +COPY *.sh /bin/ +COPY *.sql $LOADSQL_PATH/ +RUN chmod 775 /bin/run.sh && \ + mkdir -p $DATA_PATH && \ + mkdir -p $LOG_PATH && \ + touch $STARTUPLOG && \ + chown -R postgres:postgres $LOG_PATH $DATA_PATH $LOADSQL_PATH -USER postgres EXPOSE 5432 -VOLUME ["/var/log/pgsql", "/var/lib/pgsql"] - -CMD ["/sx/postgresql_run.sh"] \ No newline at end of file +VOLUME [$DATA_PATH,$LOG_PATH] +CMD ["/bin/run.sh"] -- cgit v1.2.3