File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed
Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -7,9 +7,6 @@ ENV TEMP_SQL_DIR=/temp-sql-files
77# Set the shell for safer execution
88SHELL ["/bin/bash" , "-o" , "pipefail" , "-c" ]
99
10- # Create a non-root user and group
11- RUN groupadd -r dbuser && useradd -r -g dbuser dbuser
12-
1310# Copy all files into a temporary location
1411COPY . ${TEMP_SQL_DIR}/
1512
@@ -20,16 +17,12 @@ RUN find "${TEMP_SQL_DIR:?}/" -type f -name "*.sql" | while read -r file; do \
2017 done && \
2118 rm -rf "${TEMP_SQL_DIR:?}/"
2219
23- # Set ownership and adjust permissions on the MySQL data directory
24- RUN chown -R dbuser:dbuser /docker-entrypoint-initdb.d && \
25- chown -R dbuser:dbuser /var/lib/mysql /etc/mysql
26-
2720# Expose the default MariaDB port (3306)
2821EXPOSE 3306
2922
30- # Switch to the new user
31- USER dbuser
23+ # Switch to the mysql user
24+ USER mysql
3225
3326# Add health check for the container
34- HEALTHCHECK --interval=1m --timeout=10s --start-period=30s --retries=3 \
35- CMD mysqladmin ping -h localhost || exit 1
27+ HEALTHCHECK --interval=10s --timeout=5s --start-period=30s --retries=3 \
28+ CMD healthcheck.sh --connect --innodb_initialized || exit 1
You can’t perform that action at this time.
0 commit comments