mirror of
https://github.com/moudsen/mailGraph
synced 2025-05-11 14:04:26 +02:00
v0.9.1 - Initial public beta release for testing purposes
This commit is contained in:
parent
e40342cd94
commit
2a599cb777
1
docker/.env
Normal file
1
docker/.env
Normal file
@ -0,0 +1 @@
|
|||||||
|
RESTART_POLICY=unless-stopped
|
88
docker/Dockerfile
Normal file
88
docker/Dockerfile
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
FROM ubuntu:latest
|
||||||
|
|
||||||
|
#########################################################################################################
|
||||||
|
#########################################################################################################
|
||||||
|
##
|
||||||
|
## ZABBIX-MAILGRAPH (Dockerfile)
|
||||||
|
## =============================
|
||||||
|
## Dockerfile to builld and configure the zabbix-mailgraph image.
|
||||||
|
##
|
||||||
|
## -----------------------------------------------------------------------------------------------------
|
||||||
|
## v0.9.1 2025/05/05 - Mark Oudsen - First public beta - Pending documentation
|
||||||
|
## v0.9.0 2025/05/05 - Mark Oudsen - Internal test release
|
||||||
|
## v0.1.0 2025/05/05 - Mark Oudsen - Initial build, based on idea from "dima-online
|
||||||
|
## "https://github.com/moudsen/mailGraph/issues/50
|
||||||
|
##
|
||||||
|
## -----------------------------------------------------------------------------------------------------
|
||||||
|
##
|
||||||
|
## (C) M.J.Oudsen, mark.oudsen@puzzl.nl
|
||||||
|
## MIT License
|
||||||
|
## Credits: "demi-online" (https://github.com/dima-online)
|
||||||
|
##
|
||||||
|
#########################################################################################################
|
||||||
|
#########################################################################################################
|
||||||
|
|
||||||
|
# Disable interactive functions
|
||||||
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
# Install Apache, PHP and supplimentary programs
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -y apache2 \
|
||||||
|
libapache2-mod-php \
|
||||||
|
php-curl \
|
||||||
|
php-zip \
|
||||||
|
curl \
|
||||||
|
git
|
||||||
|
|
||||||
|
# Clean out APT files
|
||||||
|
RUN rm -rf /var/lib/apt/lists/*
|
||||||
|
RUN apt-get clean -y
|
||||||
|
|
||||||
|
# Install Composer for PHP dependencies
|
||||||
|
RUN cd /tmp && curl -sS https://getcomposer.org/installer | php && mv composer.phar /usr/local/bin/composer
|
||||||
|
|
||||||
|
# Enable Apache modules
|
||||||
|
RUN a2enmod php8.3
|
||||||
|
RUN a2enmod rewrite
|
||||||
|
|
||||||
|
# Update the PHP.ini file, enable <? ?> tags and quieten logging.
|
||||||
|
RUN sed -i "s/short_open_tag = Off/short_open_tag = On/" /etc/php/8.3/apache2/php.ini
|
||||||
|
RUN sed -i "s/error_reporting = .*$/error_reporting = E_ERROR | E_WARNING | E_PARSE/" /etc/php/8.3/apache2/php.ini
|
||||||
|
|
||||||
|
# Manually set up the apache environment variables
|
||||||
|
ENV APACHE_RUN_USER=www-data
|
||||||
|
ENV APACHE_RUN_GROUP=www-data
|
||||||
|
ENV APACHE_LOG_DIR="/var/log/apache2"
|
||||||
|
ENV APACHE_LOCK_DIR="/var/lock/apache2"
|
||||||
|
ENV APACHE_PID_FILE="/var/run/apache2.pid"
|
||||||
|
|
||||||
|
# Copy the Github code into Apache site directory (run fetch_mailgraph.sh before building!)
|
||||||
|
ADD www /var/www/site/public
|
||||||
|
|
||||||
|
# Copy the cleanup script into local bin
|
||||||
|
ADD cleanup.sh /usr/local/bin/cleanup
|
||||||
|
RUN chmod +x /usr/local/bin/cleanup
|
||||||
|
|
||||||
|
# Fetch dependencies via Composer
|
||||||
|
RUN composer require phpmailer/phpmailer
|
||||||
|
RUN composer require twig/twig
|
||||||
|
|
||||||
|
# Move into the site directory
|
||||||
|
RUN mv /composer* /var/www/site/public/.
|
||||||
|
RUN mv /vendor /var/www/site/public/.
|
||||||
|
|
||||||
|
# Create some directories not existing yet
|
||||||
|
RUN mkdir /var/www/site/public/log
|
||||||
|
RUN mkdir /var/www/site/public/tmp
|
||||||
|
|
||||||
|
# Fix ownership
|
||||||
|
RUN chown www-data.www-data -R /var/www/site/public
|
||||||
|
|
||||||
|
# Update(/overwrite) the default apache site with the config we created
|
||||||
|
ADD apache-config.conf /etc/apache2/sites-enabled/000-default.conf
|
||||||
|
|
||||||
|
# Expose the HTTP port to external
|
||||||
|
EXPOSE 80
|
||||||
|
|
||||||
|
# By default, simply start apache
|
||||||
|
ENTRYPOINT ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]
|
29
docker/README.md
Normal file
29
docker/README.md
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
## Introduction ##
|
||||||
|
With the following instructions, mailGraph can be run in a Docker container.
|
||||||
|
Every new version of mailGraph will also be deployed to Docker Hub.
|
||||||
|
|
||||||
|
## Instructions - Plain vanilla deployment ##
|
||||||
|
- Create a directory structure on your system as follows:
|
||||||
|
```
|
||||||
|
mkdir /opt/Zabbix-Mailgraph
|
||||||
|
mkdir /opt/Zabbix-Mailgraph/config
|
||||||
|
mkdir /opt/Zabbix-Mailgraph/templates
|
||||||
|
```
|
||||||
|
- Create a new `config.json` in the config directory and configure accordingly (refer to the wiki for more detailed instructions or use the `config.json.template` as a boilerplate).
|
||||||
|
- Deploy the mailGraph container, preferably using `docker-compose`.
|
||||||
|
-- Adopt and configure the `docker-compose.yml` file to your needs;
|
||||||
|
-- Configure `RESTART_POLICY=unless-stopped` in a file name `.env` (same directory as `docker-compose`).
|
||||||
|
- Start the container: `docker-compose -D up`
|
||||||
|
|
||||||
|
## Testing and Debugging ##
|
||||||
|
- Display currently running containers `docker ps`
|
||||||
|
- Execute `docker exec -it <container ID> sh` for a shell into the container
|
||||||
|
- Following the instructions in the Wiki on troubleshooting and debugging
|
||||||
|
- When done testing, `exit` the container
|
||||||
|
|
||||||
|
## Periodic cleanup of images and logs ##
|
||||||
|
In case you like to adjust the container to your needs, you can adopt and modiyfy the provisioned scripts and files in this directory.
|
||||||
|
|
||||||
|
## Special thank you ##
|
||||||
|
I would like to express my gratitude to the following people that have actively contributed to bring bugs and improvements to my attention with regards for mailGraph on Docker:
|
||||||
|
- [dima-online](https://github.com/dima-online)
|
18
docker/apache-config.conf
Normal file
18
docker/apache-config.conf
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
ServerName mailgraph.mydomain.com
|
||||||
|
|
||||||
|
<VirtualHost *:80>
|
||||||
|
ServerAdmin me@mydomain.com
|
||||||
|
|
||||||
|
DocumentRoot /var/www/site/public
|
||||||
|
|
||||||
|
<Directory /var/www/site/public>
|
||||||
|
Options Indexes FollowSymLinks MultiViews
|
||||||
|
AllowOverride All
|
||||||
|
Order deny,allow
|
||||||
|
Allow from all
|
||||||
|
</Directory>
|
||||||
|
|
||||||
|
ErrorLog ${APACHE_LOG_DIR}/error.log
|
||||||
|
CustomLog ${APACHE_LOG_DIR}/access.log combined
|
||||||
|
|
||||||
|
</VirtualHost>
|
2
docker/build.sh
Executable file
2
docker/build.sh
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
docker build -t hoppa66/zabbix-mailgraph .
|
3
docker/cleanup.sh
Normal file
3
docker/cleanup.sh
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
cd /var/www/site/public
|
||||||
|
php mailGraph.php cleanup
|
13
docker/docker-compose.yml
Normal file
13
docker/docker-compose.yml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
version: '2.1'
|
||||||
|
|
||||||
|
services:
|
||||||
|
webhook:
|
||||||
|
image: hoppa66/zabbix-mailgraph:latest
|
||||||
|
restart: ${RESTART_POLICY}
|
||||||
|
hostname: mailgraph
|
||||||
|
ports:
|
||||||
|
- "9080:80"
|
||||||
|
volumes:
|
||||||
|
- /opt/Zabbix-mailGraph/apache.log:/var/log/apache2:rw
|
||||||
|
- /opt/Zabbix-mailGraph/config:/var/www/site/public/config:ro
|
||||||
|
- /opt/Zabbix-mailGraph/templates:/var/www/site/public/templates:ro
|
3
docker/fetch_mailgraph.sh
Executable file
3
docker/fetch_mailgraph.sh
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
rm -rf www
|
||||||
|
git clone https://github.com/moudsen/mailGraph.git www
|
Loading…
x
Reference in New Issue
Block a user