3
3
4
4
RUN apt-get update && apt-get upgrade -y \
5
5
&& rm -rf /var/lib/apt/lists/*
6
-
7
- COPY ["scripts/" , "/docker-entrypoint-initdb.d/" ]
8
- COPY ["bin/initialize.sh" , "bin/preflight.sh" , "bin/persistence-cleanup.sh" , "/usr/local/bin/" ]
9
- RUN chmod 755 /usr/local/bin/persistence-cleanup.sh; \
6
+
7
+ COPY ["scripts/" , "/docker-entrypoint-initdb.d/" ]
8
+ COPY ["bin/initialize.sh" , "bin/preflight.sh" , "bin/docker-healthcheck" , "bin/persistence-cleanup.sh" , "/usr/local/bin/" ]
9
+ RUN chmod 755 /usr/local/bin/docker-healthcheck; \
10
+ chmod 755 /usr/local/bin/persistence-cleanup.sh; \
10
11
chmod 755 /usr/local/bin/initialize.sh; \
11
- chmod 755 /usr/local/bin/preflight.sh; \
12
+ chmod 755 /usr/local/bin/preflight.sh; \
12
13
sed -i '/bin\/ bash/a /usr/local/bin/initialize.sh' /usr/local/bin/docker-entrypoint.sh; \
13
- sed -i '/exec "$@"/i /usr/local/bin/preflight.sh' /usr/local/bin/docker-entrypoint.sh
14
+ sed -i '/exec "$@"/i /usr/local/bin/preflight.sh' /usr/local/bin/docker-entrypoint.sh
14
15
15
16
# we need to touch and chown config files, since we cant write as mysql user
16
17
RUN touch /etc/mysql/conf.d/galera.cnf \
17
18
touch /etc/mysql/conf.d/cust.cnf \
18
19
&& chown mysql.mysql /etc/mysql/conf.d/galera.cnf \
19
- && chown mysql.mysql /etc/mysql/conf.d/cust.cnf \
20
+ && chown mysql.mysql /etc/mysql/conf.d/cust.cnf \
20
21
&& chown mysql.mysql /docker-entrypoint-initdb.d/*.sql
21
22
22
23
# we expose all Cluster related Ports
@@ -30,6 +31,8 @@ EXPOSE 3306 4444 4567 4568
30
31
ENV GALERA_USER=galera \
31
32
GALERA_PASS=galerapass \
32
33
MAXSCALE_USER=maxscale \
33
- MAXSCALE_PASS=maxscalepass \
34
+ MAXSCALE_PASS=maxscalepass \
34
35
CLUSTER_NAME=docker_cluster \
35
- MYSQL_ALLOW_EMPTY_PASSWORD=1
36
+ MYSQL_ALLOW_EMPTY_PASSWORD=1
37
+
38
+ HEALTHCHECK CMD ["docker-healthcheck" ]
0 commit comments