46 lines
1.0 KiB
Docker
46 lines
1.0 KiB
Docker
FROM mariadb:10.7.7
|
|
|
|
ENV MYSQL_ROOT_PASSWORD root
|
|
ENV TZ Europe/Madrid
|
|
ARG MOCKDATE=2001-01-01 11:00:00
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
COPY docker/docker.cnf /etc/mysql/conf.d/
|
|
COPY \
|
|
docker/docker-start.sh \
|
|
docker/docker-init.sh \
|
|
docker/docker-temp-stop.sh \
|
|
docker/docker-dump.sh \
|
|
docker/docker-structure.sh \
|
|
docker/docker-fixtures.sh \
|
|
/usr/local/bin/
|
|
|
|
RUN mkdir /mysql-data \
|
|
&& chown -R mysql:mysql /mysql-data
|
|
|
|
WORKDIR /docker-boot
|
|
|
|
COPY \
|
|
import-changes.sh \
|
|
config.ini \
|
|
dump/structure.sql \
|
|
dump/mockDate.sql \
|
|
dump/dumpedFixtures.sql \
|
|
./
|
|
RUN sed -i -e 's/@mockDate/'"$MOCKDATE"'/g' mockDate.sql \
|
|
&& gosu mysql docker-structure.sh
|
|
COPY changes ./changes
|
|
COPY dump/fixtures.sql ./
|
|
RUN gosu mysql docker-fixtures.sh
|
|
|
|
RUN echo "[INFO] -> Import finished" \
|
|
&& rm -rf /docker-boot
|
|
|
|
USER mysql
|
|
ENTRYPOINT ["docker-start.sh"]
|
|
|
|
CMD ["mysqld"]
|
|
|
|
HEALTHCHECK --interval=2s --timeout=10s --retries=200 \
|
|
CMD mysqladmin ping -h 127.0.0.1 -u root --password=root || exit 1
|