This commit is contained in:
2024-07-20 15:23:55 +02:00
parent 69ca21b80e
commit 8f35747001
11 changed files with 82 additions and 75 deletions

View File

@@ -1,26 +1,27 @@
FROM debian:buster
# Install necessary packages
RUN apt update -y && apt upgrade -y
RUN apt-get install -y mariadb-server mariadb-client gettext-base
# Installer les paquets nécessaires
RUN apt update -y && apt upgrade -y && \
apt-get install -y mariadb-server mariadb-client gettext-base procps && \
apt-get clean
# Create the required directory for the Unix socket file
RUN mkdir -p /run/mysqld /var/www
RUN chown mysql:mysql /run/mysqld
# Créer les répertoires requis
RUN mkdir -p /run/mysqld /var/www && \
chown mysql:mysql /run/mysqld
# Copy configuration files
# Copier les fichiers de configuration
COPY ./conf/50-server.cnf /etc/mysql/mariadb.conf.d/
COPY ./tools/init_db.sql /etc/mysql/init_db.sql
COPY ./tools/init_db.sql /docker-entrypoint-initdb.d/init_db.sql
COPY ./tools/init_db_template.sql /docker-entrypoint-initdb.d/init_db_template.sql
COPY ./tools/entrypoint.sh /usr/local/bin/entrypoint.sh
# Ensure the script and SQL file have the correct permissions
RUN chmod +x /usr/local/bin/entrypoint.sh
RUN chmod 644 /etc/mysql/init_db.sql
RUN chmod 644 /docker-entrypoint-initdb.d/init_db.sql
RUN chmod -R 777 /var/lib/mysql
# Assurer les permissions correctes pour le script et les fichiers SQL
RUN chmod +x /usr/local/bin/entrypoint.sh && \
chmod 644 /docker-entrypoint-initdb.d/init_db_template.sql && \
chmod -R 777 /var/lib/mysql
# Exposer le port 3306
EXPOSE 3306
# Use the entrypoint script
# Utiliser le script d'entrée
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]