first commit
Some checks failed
Vulhub Format Check and Lint / format-check (push) Has been cancelled
Vulhub Format Check and Lint / markdown-check (push) Has been cancelled
Vulhub Docker Image CI / longtime-images-test (push) Has been cancelled
Vulhub Docker Image CI / images-test (push) Has been cancelled
Some checks failed
Vulhub Format Check and Lint / format-check (push) Has been cancelled
Vulhub Format Check and Lint / markdown-check (push) Has been cancelled
Vulhub Docker Image CI / longtime-images-test (push) Has been cancelled
Vulhub Docker Image CI / images-test (push) Has been cancelled
This commit is contained in:
52
base/zabbix/3.0.3/web/Dockerfile
Normal file
52
base/zabbix/3.0.3/web/Dockerfile
Normal file
@@ -0,0 +1,52 @@
|
||||
# Usage:
|
||||
#
|
||||
# https://wiki.alpinelinux.org/wiki/Setting_up_Zabbix
|
||||
# docker build --force-rm -t zabbix-web .
|
||||
# docker run -d --name zabbix-web -h zabbix-web -p 80:80 zabbix-web
|
||||
#
|
||||
FROM alpine:3.4
|
||||
LABEL maintainer="phithon <root@leavesongs.com>"
|
||||
|
||||
ARG APK_FLAGS_COMMON="-q"
|
||||
ARG APK_FLAGS_PERSISTANT="${APK_FLAGS_COMMON} --clean-protected --no-cache"
|
||||
ARG APK_FLAGS_DEV="${APK_FLAGS_COMMON} --no-cache"
|
||||
ARG DB_TYPE=mysql
|
||||
ARG ZBX_SOURCES="http://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/3.0.3/zabbix-3.0.3.tar.gz/download"
|
||||
|
||||
ENV LANG=en_US.UTF-8 \
|
||||
TERM=xterm \
|
||||
ZBX_SOURCES=${ZBX_SOURCES} \
|
||||
ZBX_SRV_HOST=127.0.0.1 \
|
||||
ZBX_SRV_PORT=10051 \
|
||||
ZBX_SRV_NAME= \
|
||||
DB_TYPE=${DB_TYPE}
|
||||
|
||||
RUN apk update \
|
||||
&& apk add ${APK_FLAGS_PERSISTANT} mariadb-client php5-apache2 php5-sockets php5-gd php5-gettext php5-bcmath php5-ctype php5-xmlreader php5-json php5-ldap php5-mysqli ttf-dejavu \
|
||||
&& rm -rf /var/cache/apk/*
|
||||
|
||||
RUN apk add ${APK_FLAGS_DEV} --virtual build-deps tzdata bash curl tar coreutils gettext \
|
||||
&& rm -f /etc/localtime && ln -s /usr/share/zoneinfo/UTC /etc/localtime \
|
||||
&& mkdir -p /tmp/zabbix \
|
||||
&& curl -#SL "${ZBX_SOURCES}" | tar -xz -C /tmp/zabbix --strip-components 1 \
|
||||
&& mkdir -p /usr/share/webapps/ \
|
||||
&& cp -rp /tmp/zabbix/frontends/php /usr/share/webapps/zabbix \
|
||||
&& /usr/share/webapps/zabbix/locale/make_mo.sh \
|
||||
&& rm /usr/share/webapps/zabbix/fonts/DejaVuSans.ttf \
|
||||
&& ln -s /usr/share/fonts/ttf-dejavu/DejaVuSans.ttf /usr/share/webapps/zabbix/fonts/DejaVuSans.ttf \
|
||||
&& DATE=`date +%Y-%m-%d` \
|
||||
&& sed -e "s/ZABBIX_VERSION.*'\(.*\)'/ZABBIX_VERSION', '\1 ($DATE)'/g" \
|
||||
-e "s/ZABBIX_API_VERSION.*'\(.*\)'/ZABBIX_API_VERSION', '\1 ($DATE)'/g" -i /usr/share/webapps/zabbix/include/defines.inc.php \
|
||||
&& cp /usr/share/webapps/zabbix/conf/zabbix.conf.php.example /usr/share/webapps/zabbix/conf/zabbix.conf.php \
|
||||
&& apk del ${APK_FLAGS_COMMON} --purge build-deps \
|
||||
&& rm -rf /var/cache/apk/* /tmp/zabbix/ \
|
||||
&& mkdir /run/apache2 && chown apache:apache -R /run/apache2
|
||||
|
||||
COPY docker-entrypoint.sh /
|
||||
COPY conf/apache.conf /etc/apache2/conf.d/
|
||||
COPY conf/99-zabbix.ini /etc/php5/conf.d/
|
||||
|
||||
EXPOSE 80/TCP
|
||||
CMD ["/docker-entrypoint.sh"]
|
||||
|
||||
HEALTHCHECK --interval=15s --timeout=3s --retries=3 CMD wget -U Docker-HealthCheck -Y off -O /dev/null http://localhost:80 || exit 1
|
8
base/zabbix/3.0.3/web/conf/99-zabbix.ini
Normal file
8
base/zabbix/3.0.3/web/conf/99-zabbix.ini
Normal file
@@ -0,0 +1,8 @@
|
||||
max_execution_time=300
|
||||
memory_limit=128M
|
||||
post_max_size=16M
|
||||
upload_max_filesize=2M
|
||||
max_input_time=300
|
||||
always_populate_raw_post_data=-1
|
||||
date.timezone=Asia/Shanghai
|
||||
; session.save_path=/var/lib/php5
|
45
base/zabbix/3.0.3/web/conf/apache.conf
Normal file
45
base/zabbix/3.0.3/web/conf/apache.conf
Normal file
@@ -0,0 +1,45 @@
|
||||
<VirtualHost *:80>
|
||||
DocumentRoot /usr/share/webapps/zabbix/
|
||||
ServerName zabbix
|
||||
DirectoryIndex index.php
|
||||
AddType application/x-httpd-php .php .php3 .php4 .php5 .phtml
|
||||
AddType application/x-httpd-php-source .phps
|
||||
</VirtualHost>
|
||||
|
||||
<Directory "/usr/share/webapps/zabbix">
|
||||
Options FollowSymLinks
|
||||
AllowOverride None
|
||||
Require all granted
|
||||
</Directory>
|
||||
|
||||
<Directory "/usr/share/webapps/zabbix/conf">
|
||||
Require all denied
|
||||
<files *.php>
|
||||
Order deny,allow
|
||||
Deny from all
|
||||
</files>
|
||||
</Directory>
|
||||
|
||||
<Directory "/usr/share/webapps/zabbix/app">
|
||||
Require all denied
|
||||
<files *.php>
|
||||
Order deny,allow
|
||||
Deny from all
|
||||
</files>
|
||||
</Directory>
|
||||
|
||||
<Directory "/usr/share/webapps/zabbix/include">
|
||||
Require all denied
|
||||
<files *.php>
|
||||
Order deny,allow
|
||||
Deny from all
|
||||
</files>
|
||||
</Directory>
|
||||
|
||||
<Directory "/usr/share/webapps/zabbix/local">
|
||||
Require all denied
|
||||
<files *.php>
|
||||
Order deny,allow
|
||||
Deny from all
|
||||
</files>
|
||||
</Directory>
|
15
base/zabbix/3.0.3/web/docker-entrypoint.sh
Normal file
15
base/zabbix/3.0.3/web/docker-entrypoint.sh
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
# frontend config
|
||||
sed -i "s/^\(\$DB\['TYPE'\]\).*/\1 = 'MYSQL';/" /usr/share/webapps/zabbix/conf/zabbix.conf.php
|
||||
sed -i "s/^\(\$DB\['SERVER'\]\).*/\1 = '$DATABASE_HOST';/" /usr/share/webapps/zabbix/conf/zabbix.conf.php
|
||||
sed -i "s/^\(\$DB\['PORT'\]\).*/\1 = '$DATABASE_PORT';/" /usr/share/webapps/zabbix/conf/zabbix.conf.php
|
||||
sed -i "s/^\(\$DB\['DATABASE'\]\).*/\1 = '$DATABASE_NAME';/" /usr/share/webapps/zabbix/conf/zabbix.conf.php
|
||||
sed -i "s/^\(\$DB\['USER'\]\).*/\1 = '$DATABASE_USER';/" /usr/share/webapps/zabbix/conf/zabbix.conf.php
|
||||
sed -i "s/^\(\$DB\['PASSWORD'\]\).*/\1 = '$DATABASE_PASS';/" /usr/share/webapps/zabbix/conf/zabbix.conf.php
|
||||
|
||||
sed -i "s/^\(\$ZBX_SERVER\)\s.*/\1 = '$ZBX_SRV_HOST';/" /usr/share/webapps/zabbix/conf/zabbix.conf.php
|
||||
sed -i "s/^\(\$ZBX_SERVER_PORT\)\s.*/\1 = '$ZBX_SRV_PORT';/" /usr/share/webapps/zabbix/conf/zabbix.conf.php
|
||||
sed -i "s/^\(\$ZBX_SERVER_NAME\)\s.*/\1 = '$ZBX_SRV_NAME';/" /usr/share/webapps/zabbix/conf/zabbix.conf.php
|
||||
|
||||
exec /usr/sbin/httpd -D FOREGROUND
|
Reference in New Issue
Block a user