mirror of
https://github.com/zabbix/zabbix-docker.git
synced 2025-08-09 08:35:05 +02:00
Updated Alpine images
This commit is contained in:
@ -41,6 +41,7 @@ RUN set -eux && \
|
||||
php7-xmlreader \
|
||||
php7-xmlwriter \
|
||||
supervisor && \
|
||||
rm -rf /etc/php7/php-fpm.d/www.conf && \
|
||||
rm -f /etc/nginx/conf.d/*.conf && \
|
||||
rm -rf /var/cache/apk/*
|
||||
|
||||
@ -77,11 +78,14 @@ RUN set -eux && \
|
||||
chown --quiet -R zabbix:root /etc/nginx/ /etc/php7/ && \
|
||||
chgrp -R 0 /etc/nginx/ /etc/php7/ && \
|
||||
chmod -R g=u /etc/nginx/ /etc/php7/ && \
|
||||
chown --quiet -R zabbix:root /var/log/nginx/ /var/lib/nginx/ && \
|
||||
chgrp -R 0 /var/log/nginx/ /var/lib/nginx/ && \
|
||||
chmod -R g=u /var/log/nginx/ /var/lib/nginx/ && \
|
||||
apk del --purge --no-network \
|
||||
build-dependencies && \
|
||||
rm -rf /var/cache/apk/*
|
||||
|
||||
EXPOSE 80/TCP 443/TCP
|
||||
EXPOSE 8080/TCP 8443/TCP
|
||||
|
||||
WORKDIR /usr/share/zabbix
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
user zabbix;
|
||||
#user nginx;
|
||||
worker_processes 5;
|
||||
worker_rlimit_nofile 256000;
|
||||
|
||||
error_log /dev/fd/2 warn;
|
||||
|
||||
pid /var/run/nginx.pid;
|
||||
pid /tmp/nginx.pid;
|
||||
|
||||
events {
|
||||
worker_connections 5120;
|
||||
|
@ -12,7 +12,6 @@
|
||||
; Relative path can also be used. They will be prefixed by:
|
||||
; - the global prefix if it's been set (-p argument)
|
||||
; - /usr otherwise
|
||||
include = /etc/php7/php-fpm.d/*.conf
|
||||
|
||||
;;;;;;;;;;;;;;;;;;
|
||||
; Global Options ;
|
||||
@ -29,7 +28,7 @@ include = /etc/php7/php-fpm.d/*.conf
|
||||
; in a local file.
|
||||
; Note: the default prefix is /var
|
||||
; Default Value: log/php-fpm.log
|
||||
error_log = /var/log/php-fpm.log
|
||||
error_log = /dev/fd/2
|
||||
|
||||
; syslog_facility is used to specify what type of program is logging the
|
||||
; message. This lets syslogd specify that messages from different facilities
|
||||
@ -172,8 +171,8 @@ listen = /tmp/php-fpm.sock
|
||||
; BSD-derived systems allow connections regardless of permissions.
|
||||
; Default Values: user and group are set as the running user
|
||||
; mode is set to 0660
|
||||
listen.owner = nginx
|
||||
listen.group = nginx
|
||||
;listen.owner = nginx
|
||||
;listen.group = nginx
|
||||
;listen.mode = 0660
|
||||
; When POSIX Access Control Lists are supported you can set them using
|
||||
; these options, value is a comma separated list of user/group names.
|
||||
|
@ -1,5 +1,5 @@
|
||||
server {
|
||||
listen 80;
|
||||
listen 8080;
|
||||
server_name zabbix;
|
||||
index index.php;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -eo pipefail
|
||||
set -o pipefail
|
||||
|
||||
set +e
|
||||
|
||||
@ -190,7 +190,7 @@ check_variables_mysql() {
|
||||
fi
|
||||
}
|
||||
|
||||
check_db_connect_mysql() {
|
||||
check_db_connect() {
|
||||
echo "********************"
|
||||
echo "* DB_SERVER_HOST: ${DB_SERVER_HOST}"
|
||||
echo "* DB_SERVER_PORT: ${DB_SERVER_PORT}"
|
||||
@ -215,10 +215,9 @@ check_db_connect_mysql() {
|
||||
done
|
||||
}
|
||||
|
||||
prepare_web_server_nginx() {
|
||||
prepare_web_server() {
|
||||
NGINX_CONFD_DIR="/etc/nginx/conf.d"
|
||||
NGINX_SSL_CONFIG="/etc/ssl/nginx"
|
||||
PHP_SESSIONS_DIR="/var/lib/php5"
|
||||
|
||||
echo "** Adding Zabbix virtual host (HTTP)"
|
||||
if [ -f "$ZABBIX_ETC_DIR/nginx.conf" ]; then
|
||||
@ -238,12 +237,8 @@ prepare_web_server_nginx() {
|
||||
echo "**** Impossible to enable SSL support for Nginx. Certificates are missed."
|
||||
fi
|
||||
|
||||
if [ -d "/var/log/nginx/" ]; then
|
||||
ln -sf /dev/fd/2 /var/log/nginx/error.log
|
||||
fi
|
||||
|
||||
ln -sf /dev/fd/2 /var/log/php5-fpm.log
|
||||
ln -sf /dev/fd/2 /var/log/php7.2-fpm.log
|
||||
ln -sf /dev/fd/2 /var/log/nginx/error.log
|
||||
ln -sf /dev/fd/1 /var/log/php-fpm.log
|
||||
}
|
||||
|
||||
clear_deploy() {
|
||||
@ -263,37 +258,14 @@ prepare_zbx_web_config() {
|
||||
|
||||
ln -s "$ZBX_WEB_CONFIG" "/usr/share/zabbix/conf/zabbix.conf.php"
|
||||
|
||||
# Different places of PHP configuration file
|
||||
if [ -f "/etc/php5/conf.d/99-zabbix.ini" ]; then
|
||||
PHP_CONFIG_FILE="/etc/php5/conf.d/99-zabbix.ini"
|
||||
elif [ -f "/etc/php5/fpm/conf.d/99-zabbix.ini" ]; then
|
||||
PHP_CONFIG_FILE="/etc/php5/fpm/conf.d/99-zabbix.ini"
|
||||
elif [ -f "/etc/php5/apache2/conf.d/99-zabbix.ini" ]; then
|
||||
PHP_CONFIG_FILE="/etc/php5/apache2/conf.d/99-zabbix.ini"
|
||||
elif [ -f "/etc/php/7.0/apache2/conf.d/99-zabbix.ini" ]; then
|
||||
PHP_CONFIG_FILE="/etc/php/7.0/apache2/conf.d/99-zabbix.ini"
|
||||
elif [ -f "/etc/php/7.0/fpm/conf.d/99-zabbix.ini" ]; then
|
||||
PHP_CONFIG_FILE="/etc/php/7.0/fpm/conf.d/99-zabbix.ini"
|
||||
elif [ -f "/etc/php.d/99-zabbix.ini" ]; then
|
||||
PHP_CONFIG_FILE="/etc/php.d/99-zabbix.ini"
|
||||
elif [ -f "/etc/php7/conf.d/99-zabbix.ini" ]; then
|
||||
PHP_CONFIG_FILE="/etc/php7/conf.d/99-zabbix.ini"
|
||||
elif [ -f "/etc/php/7.2/fpm/conf.d/99-zabbix.ini" ]; then
|
||||
PHP_CONFIG_FILE="/etc/php/7.2/fpm/conf.d/99-zabbix.ini"
|
||||
elif [ -f "/etc/php/7.2/apache2/conf.d/99-zabbix.ini" ]; then
|
||||
PHP_CONFIG_FILE="/etc/php/7.2/apache2/conf.d/99-zabbix.ini"
|
||||
fi
|
||||
PHP_CONFIG_FILE="/etc/php7/conf.d/99-zabbix.ini"
|
||||
|
||||
if [ -n "$PHP_CONFIG_FILE" ]; then
|
||||
update_config_var "$PHP_CONFIG_FILE" "max_execution_time" "${ZBX_MAXEXECUTIONTIME:-"600"}"
|
||||
update_config_var "$PHP_CONFIG_FILE" "memory_limit" "${ZBX_MEMORYLIMIT:-"128M"}"
|
||||
update_config_var "$PHP_CONFIG_FILE" "post_max_size" "${ZBX_POSTMAXSIZE:-"16M"}"
|
||||
update_config_var "$PHP_CONFIG_FILE" "upload_max_filesize" "${ZBX_UPLOADMAXFILESIZE:-"2M"}"
|
||||
update_config_var "$PHP_CONFIG_FILE" "max_input_time" "${ZBX_MAXINPUTTIME:-"300"}"
|
||||
update_config_var "$PHP_CONFIG_FILE" "date.timezone" "${PHP_TZ}"
|
||||
else
|
||||
echo "**** Zabbix related PHP configuration file not found"
|
||||
fi
|
||||
update_config_var "$PHP_CONFIG_FILE" "max_execution_time" "${ZBX_MAXEXECUTIONTIME:-"600"}"
|
||||
update_config_var "$PHP_CONFIG_FILE" "memory_limit" "${ZBX_MEMORYLIMIT:-"128M"}"
|
||||
update_config_var "$PHP_CONFIG_FILE" "post_max_size" "${ZBX_POSTMAXSIZE:-"16M"}"
|
||||
update_config_var "$PHP_CONFIG_FILE" "upload_max_filesize" "${ZBX_UPLOADMAXFILESIZE:-"2M"}"
|
||||
update_config_var "$PHP_CONFIG_FILE" "max_input_time" "${ZBX_MAXINPUTTIME:-"300"}"
|
||||
update_config_var "$PHP_CONFIG_FILE" "date.timezone" "${PHP_TZ}"
|
||||
|
||||
# Escaping characters in parameter value
|
||||
server_name=$(escape_spec_char "${ZBX_SERVER_NAME}")
|
||||
@ -311,8 +283,6 @@ prepare_zbx_web_config() {
|
||||
-e "s/{ZBX_SERVER_PORT}/${ZBX_SERVER_PORT}/g" \
|
||||
-e "s/{ZBX_SERVER_NAME}/$server_name/g" \
|
||||
"$ZBX_WEB_CONFIG"
|
||||
|
||||
[ "$db_type" = "postgresql" ] && sed -i "s/MYSQL/POSTGRESQL/g" "$ZBX_WEB_CONFIG"
|
||||
}
|
||||
|
||||
prepare_web() {
|
||||
|
Reference in New Issue
Block a user