Public Repository

Last pushed: a year ago
Short Description
monitoramento de redes, disponibilidade de servidores
Full Description

docker run -ti -m 512m --cpu-shares 512 --name zabbix -h zabbix --restart=always --link squid --link pdc --entrypoint /bin/bash -u root


Dockerfile

FROM debian

MAINTAINER wesley valger wesleyvalger@gmail.com

LABEL description="ZABBIX 3, Monitor e Controlador de desempenho e disponibilidade de servidores de rede"

ENV APACHE_LOCK_DIR=/var/lock
ENV APACHE_LOG_DIR=/var/log
ENV APACHE_PID_FILE=/var/run/apache2.pid
ENV APACHE_RUN_USER=www-data
ENV APACHE_RUN_GROUP=www-data

ENV MYSQL_ROOT_PASSWORD=@MYzabbix
ENV MYSQL_USER=zabbixAdmin
ENV MYSQL_DATABASE=zabbix
ENV MYSQL_DATA_DIR=/var/lib/mysql
ENV MYSQL_RUN_DIR=/run/mysqld
ENV MYSQL_LOG_DIR=/var/log/mysql

WORKDIR /home/zabbixadmin

ADD zabbix_server.sh /tmp/zabbix_server.sh

RUN apt-get update && apt-get install wget -y && wget http://repo.zabbix.com/zabbix/3.0/debian/pool/main/z/zabbix-release/zabbix-release_3.0-1+jessie_all.deb && dpkg -i zabbix-release_3.0-1+jessie_all.deb && apt-get update && apt-get dist-upgrade -y && DEBIAN_FRONTEND=noninteractive apt-get install apache2 php5 php5-mysql php5-ldap net-tools apache2 apache2-utils zabbix-server-mysql zabbix-frontend-php -y && apt-get autoremove && apt-get autoclean && rm -f zabbix-release_3.0-1+jessie_all.deb && cd /tmp/ && ./zabbix_server.sh && echo "/etc/init.d/mysql_apache.sh" >> /etc/bash.bashrc && gunzip /usr/share/doc/zabbix-server-mysql/create.sql.gz && sed -i -e "1i\ create database if not exists zabbix; \n use zabbix; \n grant all privileges on zabbix.* to 'zabbix'@'localhost' identified by 'zabbix'; \n flush privileges;" /usr/share/doc/zabbix-server-mysql/create.sql && /etc/init.d/mysql start && mysql -u root < /usr/share/doc/zabbix-server-mysql/create.sql && sed -i -e "585i\date.timezone =America/Sao_paulo " /etc/php5/apache2/php.ini && echo -e "DBHost=localhost \nDBName=zabbix \nDBUser=zabbix\nDBPassword=zabbix" >> /etc/zabbix/zabbix_server.conf

ADD mysql_apache.sh /etc/init.d/mysql_apache.sh
ADD 000-default.conf /etc/apache2/sites-available/000-default.conf

CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]

USER zabbixadmin

VOLUME /var/log/apache2
VOLUME /var/www/html

EXPOSE 80 443 3306


criar arquivo junto ao Dockerfile


mysql_apache.sh

#!/bin/bash

/usr/sbin/apache2ctl start
/etc/init.d/mysql start



000-default.conf

ServerName 127.0.0.1

<VirtualHost *:80>

ServerAdmin ti@localhost
DocumentRoot /usr/share/zabbix/

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

Docker Pull Command
Owner
wesleyvalger