Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
gmicroul authored Oct 21, 2024
1 parent 63bff2c commit fed3a7c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fed3a7c

Please sign in to comment.