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:
@ -4,7 +4,7 @@ LABEL org.opencontainers.image.title="Zabbix web-interface (Apache, PostgreSQL)"
|
||||
org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" \
|
||||
org.opencontainers.image.vendor="Zabbix LLC" \
|
||||
org.opencontainers.image.url="https://zabbix.com/" \
|
||||
org.opencontainers.image.description="abbix web-interface based on Apache2 web server with PostgreSQL database support" \
|
||||
org.opencontainers.image.description="Zabbix web-interface based on Apache2 web server with PostgreSQL database support" \
|
||||
org.opencontainers.image.licenses="GPL v2.0"
|
||||
|
||||
STOPSIGNAL SIGTERM
|
||||
@ -47,9 +47,10 @@ RUN set -eux && \
|
||||
-e 's!^(\s*ErrorLog)\s+\S+!\1 /proc/self/fd/2!g' \
|
||||
"/etc/apache2/httpd.conf" && \
|
||||
sed -ri \
|
||||
-e 's!^(\s*PidFile)\s+\S+!\1 "/var/run/httpd.pid"!g' \
|
||||
-e 's!^(\s*PidFile)\s+\S+!\1 "/tmp/httpd.pid"!g' \
|
||||
"/etc/apache2/conf.d/mpm.conf" && \
|
||||
rm -f "/var/run/apache2/apache2.pid" && \
|
||||
sed -i 's/Listen 80/Listen 8080/g' /etc/apache2/httpd.conf && \
|
||||
rm -rf "/var/run/apache2/" && \
|
||||
rm -rf /var/cache/apk/*
|
||||
|
||||
ARG MAJOR_VERSION=master
|
||||
@ -88,7 +89,7 @@ RUN set -eux && \
|
||||
build-dependencies && \
|
||||
rm -rf /var/cache/apk/*
|
||||
|
||||
EXPOSE 80/TCP 443/TCP
|
||||
EXPOSE 8080/TCP 8443/TCP
|
||||
|
||||
WORKDIR /usr/share/zabbix
|
||||
|
||||
|
@ -6,4 +6,3 @@ max_input_time=300
|
||||
; always_populate_raw_post_data=-1
|
||||
max_input_vars=10000
|
||||
; date.timezone=Europe/Riga
|
||||
; session.save_path=/var/lib/php5
|
||||
|
@ -1,4 +1,4 @@
|
||||
<VirtualHost *:80>
|
||||
<VirtualHost *:8080>
|
||||
DocumentRoot /usr/share/zabbix/
|
||||
ServerName zabbix
|
||||
DirectoryIndex index.php
|
||||
|
@ -1,10 +1,10 @@
|
||||
LoadModule ssl_module modules/mod_ssl.so
|
||||
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
|
||||
|
||||
Listen 443
|
||||
Listen 8443
|
||||
|
||||
<IfModule mod_ssl.c>
|
||||
<VirtualHost *:443>
|
||||
<VirtualHost *:8443>
|
||||
SSLEngine on
|
||||
|
||||
DocumentRoot /usr/share/zabbix/
|
||||
|
@ -123,7 +123,7 @@ update_config_var() {
|
||||
}
|
||||
|
||||
# Check prerequisites for PostgreSQL database
|
||||
check_variables_postgresql() {
|
||||
check_variables() {
|
||||
file_env POSTGRES_USER
|
||||
file_env POSTGRES_PASSWORD
|
||||
|
||||
@ -142,7 +142,7 @@ check_variables_postgresql() {
|
||||
DB_SERVER_DBNAME=${POSTGRES_DB:-"zabbix"}
|
||||
}
|
||||
|
||||
check_db_connect_postgresql() {
|
||||
check_db_connect() {
|
||||
echo "********************"
|
||||
echo "* DB_SERVER_HOST: ${DB_SERVER_HOST}"
|
||||
echo "* DB_SERVER_PORT: ${DB_SERVER_PORT}"
|
||||
@ -183,31 +183,7 @@ check_db_connect_postgresql() {
|
||||
unset PGOPTIONS
|
||||
}
|
||||
|
||||
psql_query() {
|
||||
query=$1
|
||||
db=$2
|
||||
|
||||
local result=""
|
||||
|
||||
if [ -n "${DB_SERVER_ZBX_PASS}" ]; then
|
||||
export PGPASSWORD="${DB_SERVER_ZBX_PASS}"
|
||||
fi
|
||||
|
||||
if [ -n "${DB_SERVER_SCHEMA}" ]; then
|
||||
PGOPTIONS="--search_path=${DB_SERVER_SCHEMA}"
|
||||
export PGOPTIONS
|
||||
fi
|
||||
|
||||
result=$(psql -A -q -t -h ${DB_SERVER_HOST} -p ${DB_SERVER_PORT} \
|
||||
-U ${DB_SERVER_ROOT_USER} -c "$query" $db 2>/dev/null);
|
||||
|
||||
unset PGPASSWORD
|
||||
unset PGOPTIONS
|
||||
|
||||
echo $result
|
||||
}
|
||||
|
||||
prepare_web_server_apache() {
|
||||
prepare_web_server() {
|
||||
APACHE_SITES_DIR=/etc/apache2/conf.d
|
||||
|
||||
echo "** Adding Zabbix virtual host (HTTP)"
|
||||
@ -264,19 +240,35 @@ prepare_zbx_web_config() {
|
||||
|
||||
prepare_web() {
|
||||
echo "** Preparing Zabbix web-interface"
|
||||
|
||||
check_variables_postgresql
|
||||
check_db_connect_postgresql
|
||||
prepare_web_server_apache
|
||||
|
||||
check_variables
|
||||
check_db_connect
|
||||
prepare_web_server
|
||||
prepare_zbx_web_config
|
||||
}
|
||||
|
||||
|
||||
#################################################
|
||||
|
||||
if [ "$1" == '/usr/sbin/httpd' ]; then
|
||||
prepare_web
|
||||
echo "** Deploying Zabbix web-interface (Apache) with MySQL database"
|
||||
|
||||
prepare_system
|
||||
|
||||
prepare_web
|
||||
|
||||
clear_deploy
|
||||
|
||||
echo "########################################################"
|
||||
|
||||
if [ "$1" != "" ]; then
|
||||
echo "** Executing '$@'"
|
||||
exec "$@"
|
||||
elif [ -f "/usr/bin/supervisord" ]; then
|
||||
echo "** Executing supervisord"
|
||||
exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf
|
||||
else
|
||||
echo "Unknown instructions. Exiting..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exec "$@"
|
||||
|
||||
#################################################
|
||||
|
Reference in New Issue
Block a user