summaryrefslogtreecommitdiffstats
path: root/Services/mariadb/Dockerfile
blob: fbeaccebe2579a5325df3d8e38213993baf61111 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
FROM startx/fedora
MAINTAINER Christophe LARUE <dev@startx.fr>

USER root
RUN dnf -y install  mariadb-common mariadb-libs mariadb-config mariadb-errmsg mariadb-server mariadb \
    && dnf clean all && \
    mkdir -p /tmp/sql 
ENV MY_CONF=/etc/my.cnf \
    STARTUPLOG=/data/logs/mariadb/startup.log \
    LOG_PATH=/data/logs/mariadb \
    DATA_PATH=/data/mariadb \
    LOADSQL_PATH=/tmp/sql 
COPY *.sh /bin/
COPY my.cnf $MY_CONF
COPY *.sql $LOADSQL_PATH/
RUN chmod 775 /bin/run.sh && \
    chmod ug+r $MY_CONF && \
    mkdir /data && \
    mkdir /data/logs && \
    mkdir $DATA_PATH && \
    mkdir $LOG_PATH && \
    touch $STARTUPLOG && \
    touch $DATA_PATH/.keep && \
    chown -R mariadb:mariadb $LOG_PATH $DATA_PATH $LOADSQL_PATH

EXPOSE 3306
VOLUME [$DATA_PATH,$LOG_PATH]

CMD ["/sx/run.sh"]