salix/db/Dockerfile

46 lines
1.0 KiB
Docker
Raw Permalink Normal View History

2023-05-31 12:58:16 +00:00
FROM mariadb:10.7.7
2019-01-04 12:32:04 +00:00
2023-05-31 13:00:33 +00:00
ENV MYSQL_ROOT_PASSWORD root
2019-01-04 12:32:04 +00:00
ENV TZ Europe/Madrid
2023-05-17 11:14:43 +00:00
ARG MOCKDATE=2001-01-01 11:00:00
2019-01-04 12:32:04 +00:00
ARG DEBIAN_FRONTEND=noninteractive
2023-05-17 11:14:43 +00:00
2019-12-11 14:01:01 +00:00
COPY docker/docker.cnf /etc/mysql/conf.d/
2020-09-28 08:40:50 +00:00
COPY \
docker/docker-start.sh \
docker/docker-init.sh \
docker/docker-temp-stop.sh \
2020-09-28 08:40:50 +00:00
docker/docker-dump.sh \
2023-06-09 12:38:44 +00:00
docker/docker-structure.sh \
docker/docker-fixtures.sh \
2020-09-28 08:40:50 +00:00
/usr/local/bin/
2019-01-08 19:15:47 +00:00
2019-12-11 14:01:01 +00:00
RUN mkdir /mysql-data \
&& chown -R mysql:mysql /mysql-data
2019-04-03 08:29:05 +00:00
2020-09-28 08:40:50 +00:00
WORKDIR /docker-boot
COPY \
import-changes.sh \
config.ini \
dump/structure.sql \
2023-05-16 13:00:31 +00:00
dump/mockDate.sql \
2020-09-28 08:40:50 +00:00
dump/dumpedFixtures.sql \
./
2023-06-09 12:38:44 +00:00
RUN sed -i -e 's/@mockDate/'"$MOCKDATE"'/g' mockDate.sql \
&& gosu mysql docker-structure.sh
2020-09-28 08:40:50 +00:00
COPY changes ./changes
COPY dump/fixtures.sql ./
2023-06-09 12:38:44 +00:00
RUN gosu mysql docker-fixtures.sh
2020-09-28 08:40:50 +00:00
RUN echo "[INFO] -> Import finished" \
2020-08-07 12:35:20 +00:00
&& rm -rf /docker-boot
2019-01-04 12:32:04 +00:00
2019-12-11 14:01:01 +00:00
USER mysql
ENTRYPOINT ["docker-start.sh"]
2019-12-11 14:01:01 +00:00
CMD ["mysqld"]
2019-01-04 12:32:04 +00:00
2020-09-28 08:40:50 +00:00
HEALTHCHECK --interval=2s --timeout=10s --retries=200 \
CMD mysqladmin ping -h 127.0.0.1 -u root --password=root || exit 1