-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
43 lines (34 loc) · 1.29 KB
/
Dockerfile
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
FROM mysql:8.0.28
# need jq to parse JSON
# netcat to wait for when mysql is ready to listen
# tmpreaper to cleanup old dump
# python for a basic http server used for ezmaster
# vim for debug stuff
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get -y update && apt-get -y install netcat jq tmpreaper vim python pwgen
COPY config.json /
COPY docker-entrypoint.overload.sh /usr/local/bin/
# mysql data folder dedicated to ezmaster
# because it's not yet (8 nov 2017) possible to UNVOLUME /data/db and /data/configdb
RUN mkdir -p /ezdata/db && chown -R mysql:mysql /ezdata/db
COPY mysqld.cnf /etc/mysql/conf.d/
# backup stuff
RUN mkdir -p /ezdata/dump/
COPY dump.periodically.sh /usr/local/bin/
COPY apply.config.sh /usr/local/bin/
# basic http server stuff
RUN mkdir /www
COPY index.* /www/
# ezmasterization of refgpec
# see https://github.com/Inist-CNRS/ezmaster
# notice: httpPort is useless here but as ezmaster require it (v3.8.1) we just add a wrong port number
RUN echo '{ \
"httpPort": 3000, \
"configPath": "/config.json", \
"configType": "json", \
"dataPath": "/ezdata", \
"technicalApplication": true \
}' > /etc/ezmaster.json
ENV MYSQL_ROOT_PASSWORD_FILE /run/secrets/mysql-root
ENTRYPOINT [ "docker-entrypoint.overload.sh" ]
CMD [ "mysqld", "--default-authentication-plugin=mysql_native_password" ]