salix/db/Dockerfile

40 lines
1.1 KiB
Docker

FROM mariadb:10.4.13
ENV MYSQL_ROOT_PASSWORD root
ENV TZ Europe/Madrid
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl ca-certificates \
&& curl -sL 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-mariadb \
&& apt-get purge -y --auto-remove curl ca-certificates \
&& rm -rf /var/lib/apt/lists/*
COPY docker/docker.cnf /etc/mysql/conf.d/
COPY docker/docker-init.sh docker/docker-start.sh /usr/local/bin/
RUN mkdir /mysql-data \
&& chown -R mysql:mysql /mysql-data
COPY dump /docker-boot/dump
COPY changes /docker-boot/changes
COPY import-changes.sh config.ini /docker-boot/
COPY docker/docker-boot.sh /docker-entrypoint-initdb.d/
ARG STAMP=unknown
RUN gosu mysql docker-init.sh mysqld \
&& rm -rf /docker-entrypoint-initdb.d/* \
&& rm -rf /docker-boot
USER mysql
ENTRYPOINT ["docker-start.sh"]
CMD ["mysqld"]
HEALTHCHECK --interval=5s --timeout=10s --retries=200 \
CMD mysqladmin ping -h 127.0.0.1 -u root || exit 1