From fed3a7c4cbecaef52e7704bc570bcfbd8125e34e Mon Sep 17 00:00:00 2001 From: gmicroul <121873438+gmicroul@users.noreply.github.com> Date: Mon, 21 Oct 2024 15:43:16 +0800 Subject: [PATCH] Update Dockerfile --- Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index ec3faf3..07c59bc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,16 +21,17 @@ COPY zabbix_agent2.conf /etc/zabbix/zabbix_agent2.conf COPY apache.conf /etc/zabbix/apache.conf COPY php.ini /etc/php/8.1/apache2/php.ini # COPY server.sql /. -COPY server.sql.zip /. +# COPY server.sql.zip /. # 配置MySQL -RUN unzip /server.sql.zip && rm -f /server.sql.zip \ +RUN gunzip /usr/share/zabbix-sql-scripts/mysql/server.sql.gz \ +# RUN unzip /server.sql.zip && rm -f /server.sql.zip \ && sed -i 's/bind-address/#bind-address/' /etc/mysql/mysql.conf.d/mysqld.cnf \ && service mysql restart && mysql -e "create database zabbix character set utf8mb4 collate utf8mb4_bin;" \ && service mysql restart && mysql -e "create user zabbix@localhost identified by 'password';" \ && service mysql restart && mysql -e "grant all privileges on zabbix.* to zabbix@localhost;" \ && service mysql restart && mysql -e "set global log_bin_trust_function_creators = 1;" \ && service mysql restart && mysql -e "FLUSH PRIVILEGES;" \ - && service mysql restart && mysql -e "use zabbix;source /server.sql;" \ + && service mysql restart && mysql -e "use zabbix;source /usr/share/zabbix-sql-scripts/mysql/server.sql;" \ && cp -r /usr/share/zabbix/ /var/www/html/ # 暴露Zabbix Frontend端口 EXPOSE 80 3306 11050