summaryrefslogtreecommitdiffstats
path: root/Services/postgres/Dockerfile
blob: a8da28e8a8daca18fe10a8371436f3a50381ed25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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 /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

EXPOSE 5432
VOLUME [$DATA_PATH,$LOG_PATH]
CMD ["/bin/run.sh"]