update
This commit is contained in:
57
zabbix/Dockerfile
Normal file
57
zabbix/Dockerfile
Normal file
@@ -0,0 +1,57 @@
|
||||
ARG ARCH
|
||||
FROM harbor.colben.cn/general/nginx-php$ARCH
|
||||
MAINTAINER Colben colbenlee@gmail.com
|
||||
ADD --chown=root:root /ADD/ /opt/
|
||||
RUN apk update \
|
||||
&& apk add --no-cache mariadb mariadb-client \
|
||||
zabbix-mysql zabbix zabbix-webif zabbix-setup \
|
||||
&& rm -rf /var/cache/apk/* /etc/my.cnf* /etc/mysql/* \
|
||||
&& echo -e '[mysqld]\n'> /etc/my.cnf \
|
||||
&& echo -e '[client-server]\n\
|
||||
socket = /run/mysqld/mysqld.sock\n\
|
||||
[mysqld]\n\
|
||||
datadir = /var/lib/mysql\n\
|
||||
pid-file = /run/mysqld/mysqld.pid\n\
|
||||
log-error = /var/log/mysql/error.log\n\
|
||||
character-set-server = utf8mb4\n\
|
||||
default-storage-engine = innodb\n\
|
||||
slow-query-log = TRUE\n\
|
||||
slow-query-log-file = /var/log/mysql/slow.log\n\
|
||||
lower-case-table-names = 1\n\
|
||||
' > /etc/mysql/my.cnf \
|
||||
&& sed -i 's/stty/#stty/' /usr/bin/mysql_secure_installation \
|
||||
&& mkdir -p /var/log/mysql /var/lib/mysql-bin /run/mysqld \
|
||||
&& chown -R mysql.mysql /var/log/mysql /var/lib/mysql-bin /run/mysqld \
|
||||
&& chmod -R 0777 /usr/share/webapps/zabbix/conf \
|
||||
&& sed -i '/^#* *AllowRoot *=/cAllowRoot=1' /etc/zabbix/zabbix_server.conf \
|
||||
&& mv /etc/zabbix/* /usr/share/zabbix/ \
|
||||
&& echo -e 'server {\n\
|
||||
listen 80;\n\
|
||||
server_name zabbix.colben.cn;\n\
|
||||
access_log /var/log/nginx/access-zabbix.log main;\n\
|
||||
error_log /var/log/nginx/error-zabbix.log;\n\
|
||||
location /zabbix/ {\n\
|
||||
root /usr/share/webapps;\n\
|
||||
index index.php index.html index.html;\n\
|
||||
}\n\
|
||||
location ~ ^/zabbix/.+\.php$ {\n\
|
||||
root /usr/share/webapps;\n\
|
||||
access_log /var/log/nginx/access-zabbix.log main;\n\
|
||||
index index.php index.html index.html;\n\
|
||||
expires -1s;\n\
|
||||
include fastcgi_params;\n\
|
||||
try_files $uri =404;\n\
|
||||
fastcgi_pass unix:/var/lib/php7/phpfpm.sock;\n\
|
||||
fastcgi_index index.php;\n\
|
||||
fastcgi_param PATH_INFO $fastcgi_path_info;\n\
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n\
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;\n\
|
||||
break;\n\
|
||||
}\n\
|
||||
location / {\n\
|
||||
return 403;\n\
|
||||
}\n\
|
||||
}\n\
|
||||
' > /usr/share/zabbix/nginx.conf
|
||||
CMD ["/opt/ccmd"]
|
||||
|
Reference in New Issue
Block a user