summaryrefslogtreecommitdiffstats
path: root/Services/postgres/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'Services/postgres/Dockerfile')
-rw-r--r--Services/postgres/Dockerfile29
1 files changed, 16 insertions, 13 deletions
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 <dev@startx.fr>
+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"]