From 2fbddfb5866f908bcebd94b234f2b2c589d05929 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Fri, 4 Jan 2019 15:20:02 +0100 Subject: [PATCH] Speed of local db docker regeneration improved --- services/db/Dockerfile | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/services/db/Dockerfile b/services/db/Dockerfile index 71febebb0..3f443c5c3 100644 --- a/services/db/Dockerfile +++ b/services/db/Dockerfile @@ -3,24 +3,27 @@ FROM mysql:5.6 ENV MYSQL_ROOT_PASSWORD root ENV TZ Europe/Madrid +RUN cp /usr/local/bin/docker-entrypoint.sh /usr/local/bin/docker-init.sh \ + && sed -i '$ d' /usr/local/bin/docker-init.sh + ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update \ && apt-get install -y --no-install-recommends curl ca-certificates \ && curl -L https://apt.verdnatura.es/conf/verdnatura.gpg | apt-key add - \ && echo "deb http://apt.verdnatura.es/ jessie main" > /etc/apt/sources.list.d/vn.list \ && apt-get update \ - && apt-get install -y vn-mysql - -RUN cp /usr/local/bin/docker-entrypoint.sh /usr/local/bin/my-docker-entrypoint.sh \ - && sed -i '$ d' /usr/local/bin/my-docker-entrypoint.sh + && apt-get install -y vn-mysql \ + && apt-get purge -y --auto-remove curl ca-certificates \ + && rm -rf /var/lib/apt/lists/* WORKDIR /docker-entrypoint-initdb.d COPY install /docker-entrypoint-initdb.d RUN mkdir /mysql-data \ - && chmod 770 /mysql-data - -RUN /usr/local/bin/my-docker-entrypoint.sh mysqld --datadir /mysql-data + && /usr/local/bin/docker-init.sh mysqld --datadir /mysql-data \ + && chown -R mysql:mysql /mysql-data \ + && rm -rf /docker-entrypoint-initdb.d/* +USER mysql CMD ["mysqld", "--datadir", "/mysql-data"] #HEALTHCHECK --interval=5s --timeout=10s --retries=200 \