From 3e85dbf451f16b7d7441c1d7383b332eb4733aa8 Mon Sep 17 00:00:00 2001 From: simatec Date: Tue, 8 Mar 2022 12:02:21 +0100 Subject: [PATCH] (simatec) first Beta --- .env | 1 - README.md | 63 +++++++++++++++++++++++++++++ docker-compose.yml | 80 +++++++++++++++++++++++++++++++++++++ install-piler.sh | 98 ++++++++++++++++++++++++++++++++++++++++++++++ piler.conf | 26 +++++++++++- 5 files changed, 266 insertions(+), 2 deletions(-) delete mode 100644 .env create mode 100644 docker-compose.yml create mode 100644 install-piler.sh diff --git a/.env b/.env deleted file mode 100644 index bd41cba..0000000 --- a/.env +++ /dev/null @@ -1 +0,0 @@ -12345 \ No newline at end of file diff --git a/README.md b/README.md index 476c16a..29457ac 100644 --- a/README.md +++ b/README.md @@ -13,3 +13,66 @@ https://www.mailpiler.org/ ### Installation Guide: +* Install Docker + +`curl -sSL https://get.docker.com/ | CHANNEL=stable sh +systemctl enable --now docker` + +* Install Docker-Compose + +`curl -L https://github.com/docker/compose/releases/download/$(curl -Ls https://www.servercow.de/docker-compose/latest.php)/docker-compose-$(uname -s)-$(uname -m) > /usr/local/bin/docker-compose +chmod +x /usr/local/bin/docker-compose` + +* reboot your system + +`reboot now` + +* remove postfix + +`apt purge postfix` + +* Clone repository + +`cd /opt +clone https://github.com/simatec/piler-docker.git +cd /opt/piler-docker` + +configure your Piler seetings + +`nano piler.conf` + +after config start the Install + +`./install-piler.sh` + +Congratulations your Piler is installed... + +********************************************************************************************************** + +## Changelog + +### 0.1.0 (08.03.2022) +* (simatec) first beta + +## License +MIT License + +Copyright (c) 2022 simatec + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..2ad8eb8 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,80 @@ +version: "3" +services: + + mysql: + image: mariadb:10.5 + container_name: mysql_piler + restart: unless-stopped + cap_drop: + - ALL + cap_add: + - dac_override + - setuid + - setgid + environment: + - MYSQL_DATABASE=${MYSQL_DATABASE} + - MYSQL_USER=${MYSQL_USER} + - MYSQL_PASSWORD=${MYSQL_PASSWORD} + - MYSQL_RANDOM_ROOT_PASSWORD=yes + - "TZ=Europe/Berlin" + command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci + healthcheck: + test: mysql --user=${MYSQL_USER} --password=${MYSQL_PASSWORD} piler --execute "show tables" + interval: "60s" + timeout: "5s" + start_period: "15s" + retries: 3 + volumes: + - db_data:/var/lib/mysql + + memcached: + image: memcached:latest + container_name: memcached_piler + restart: unless-stopped + cap_drop: + - ALL + command: -m 64 + + piler: + image: sutoj/piler:1.3.11 + container_name: piler + restart: unless-stopped + hostname: ${PILER_DOMAIN} + init: true + environment: + - MYSQL_DATABASE=${MYSQL_DATABASE} + - MYSQL_USER=${MYSQL_USER} + - MYSQL_PASSWORD=${MYSQL_PASSWORD} + - MYSQL_HOSTNAME=mysql + - PILER_HOSTNAME=${PILER_DOMAIN} + - MEMCACHED_HOST=memcached + - TZ=Europe/Berlin + ports: + - "25:25" + - "8080:80" + - "8443:443" + volumes: + - piler_etc:/etc/piler + - piler_var:/var/piler + - /etc/localtime:/etc/localtime + healthcheck: + test: curl -s smtp://localhost/ + interval: "60s" + timeout: "3s" + start_period: "15s" + retries: 3 + deploy: + resources: + reservations: + memory: 512M + limits: + memory: 512M + + depends_on: + - "memcached" + - "mysql" + +volumes: + db_data: {} + piler_etc: {} + piler_var: {} diff --git a/install-piler.sh b/install-piler.sh new file mode 100644 index 0000000..b101a6e --- /dev/null +++ b/install-piler.sh @@ -0,0 +1,98 @@ +#!/bin/bash + +. ./piler.conf +ln -s ./piler.conf .env + +# docker stop +echo "start docker-compose for Piler" + +cd /opt/piler +docker-compose up -d + +echo "backup the File config-site.php" +cp /var/lib/docker/volumes/piler_piler_etc/_data/config-site.php /var/lib/docker/volumes/piler_piler_etc/_data/config-site.php.bak + +echo "set User settings ..." + +cat >> /var/lib/docker/volumes/piler_piler_etc/_data/config-site.php <> /var/lib/docker/volumes/piler_piler_etc/_data/config-site.php <