Merge pull request #1 from Hyperling/dev
Enhancements and Reverse Proxy Skeleton
This commit is contained in:
commit
618afc8e1d
@ -1,37 +0,0 @@
|
|||||||
# MailServer configuration.
|
|
||||||
# This is a revised version of the original work here:
|
|
||||||
# https://github.com/docker-mailserver/docker-mailserver
|
|
||||||
|
|
||||||
services:
|
|
||||||
mailserver:
|
|
||||||
image: docker.io/mailserver/docker-mailserver:latest
|
|
||||||
container_name: mailserver
|
|
||||||
# If the FQDN for your mail-server is only two labels (eg: example.com),
|
|
||||||
# you can assign this entirely to `hostname` and remove `domainname`.
|
|
||||||
hostname: mail
|
|
||||||
domainname: hyperling.com
|
|
||||||
env_file: mailserver.env
|
|
||||||
# More information about the mail-server ports:
|
|
||||||
# https://docker-mailserver.github.io/docker-mailserver/edge/config/security/understanding-the-ports/
|
|
||||||
# To avoid conflicts with yaml base-60 float, DO NOT remove the quotation marks.
|
|
||||||
ports:
|
|
||||||
- "25:25" # SMTP (explicit TLS => STARTTLS)
|
|
||||||
- "143:143" # IMAP4 (explicit TLS => STARTTLS)
|
|
||||||
- "465:465" # ESMTP (implicit TLS)
|
|
||||||
- "587:587" # ESMTP (explicit TLS => STARTTLS)
|
|
||||||
- "993:993" # IMAP4 (implicit TLS)
|
|
||||||
volumes:
|
|
||||||
- /opt/Docker/Volumes/MailServer/data:/var/mail/
|
|
||||||
- /opt/Docker/Volumes/MailServer/state:/var/mail-state/
|
|
||||||
- /opt/Docker/Volumes/MailServer/logs:/var/log/mail/
|
|
||||||
- /opt/Docker/Volumes/MailServer/config:/tmp/docker-mailserver/
|
|
||||||
- /etc/localtime:/etc/localtime:ro
|
|
||||||
restart: always
|
|
||||||
stop_grace_period: 1m
|
|
||||||
cap_add:
|
|
||||||
- NET_ADMIN
|
|
||||||
healthcheck:
|
|
||||||
test: "ss --listening --tcp | grep -P 'LISTEN.+:smtp' || exit 1"
|
|
||||||
timeout: 3s
|
|
||||||
retries: 0
|
|
||||||
|
|
11
Config/ReverseProxy/Dockerfile.disabled
Normal file
11
Config/ReverseProxy/Dockerfile.disabled
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# 2022-10-05 Hyperling
|
||||||
|
# Move config to nginx container.
|
||||||
|
# This is because nginx image does not play well with Volumes.
|
||||||
|
# Nextcloud and MariaDB created files in their folders fine, but nginx stays empty.
|
||||||
|
|
||||||
|
FROM nginx
|
||||||
|
|
||||||
|
COPY ./config/nginx.conf /etc/nginx/nginx.conf
|
||||||
|
|
||||||
|
COPY ./config/conf.d/* /etc/nginx/conf.d/
|
||||||
|
|
2
Config/ReverseProxy/config/conf.d/test.conf
Normal file
2
Config/ReverseProxy/config/conf.d/test.conf
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# 2022-10-05 Hyperling
|
||||||
|
# Just a dummy test file.
|
34
Config/ReverseProxy/config/nginx.conf
Normal file
34
Config/ReverseProxy/config/nginx.conf
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
# 2022-10-05 Hyperling
|
||||||
|
|
||||||
|
user nginx;
|
||||||
|
worker_processes auto;
|
||||||
|
|
||||||
|
error_log /var/log/nginx/error.log notice;
|
||||||
|
pid /var/run/nginx.pid;
|
||||||
|
|
||||||
|
|
||||||
|
events {
|
||||||
|
worker_connections 1024;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
http {
|
||||||
|
include /etc/nginx/mime.types;
|
||||||
|
default_type application/octet-stream;
|
||||||
|
|
||||||
|
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||||
|
'$status $body_bytes_sent "$http_referer" '
|
||||||
|
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||||
|
|
||||||
|
access_log /var/log/nginx/access.log main;
|
||||||
|
|
||||||
|
sendfile on;
|
||||||
|
#tcp_nopush on;
|
||||||
|
|
||||||
|
keepalive_timeout 65;
|
||||||
|
|
||||||
|
#gzip on;
|
||||||
|
|
||||||
|
include /etc/nginx/conf.d/*.conf;
|
||||||
|
}
|
||||||
|
|
60
bin/install.sh
Executable file → Normal file
60
bin/install.sh
Executable file → Normal file
@ -4,19 +4,55 @@
|
|||||||
# Original comands came from here: https://docs.docker.com/engine/install/debian/
|
# Original comands came from here: https://docs.docker.com/engine/install/debian/
|
||||||
# usage: install.sh
|
# usage: install.sh
|
||||||
|
|
||||||
apt purge docker docker-engine docker.io containerd runc
|
## Variables ##
|
||||||
|
|
||||||
apt update &&
|
os=`grep ^'NAME=' /etc/os-release`
|
||||||
apt install -y ca-certificates curl gnupg lsb-release &&
|
pkgmgr=""
|
||||||
mkdir -p /etc/apt/keyrings &&
|
|
||||||
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg &&
|
## Validations ##
|
||||||
echo \
|
|
||||||
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
|
if [[ "$os" == *"Debian"* ]]; then
|
||||||
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null &&
|
repo="debian"
|
||||||
apt update &&
|
pkgmgr="apt"
|
||||||
apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin &&
|
elif [[ "$os" == *"Ubuntu"* ]]; then
|
||||||
exit 0
|
repo="ubuntu"
|
||||||
|
pkgmgr="apt"
|
||||||
|
elif [[ $os == "Arch Linux" ]]; then
|
||||||
|
pkgmgr="pacman"
|
||||||
|
else
|
||||||
|
echo "Distribution not yet supported." &&
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "os=$os"
|
||||||
|
echo "repo=$repo"
|
||||||
|
echo "pkgmgr=$pkgmgr"
|
||||||
|
|
||||||
|
## Main ##
|
||||||
|
|
||||||
|
if [[ "$pkgmgr" == "apt" ]]; then
|
||||||
|
apt purge docker docker-engine docker.io containerd runc
|
||||||
|
|
||||||
|
apt update &&
|
||||||
|
apt install -y ca-certificates curl gnupg lsb-release &&
|
||||||
|
mkdir -p /etc/apt/keyrings &&
|
||||||
|
curl -fsSL https://download.docker.com/linux/$repo/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg &&
|
||||||
|
echo \
|
||||||
|
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/$repo \
|
||||||
|
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null &&
|
||||||
|
apt update &&
|
||||||
|
apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin &&
|
||||||
|
|
||||||
|
echo "Success!" &&
|
||||||
|
exit 0
|
||||||
|
elif [[ $pkgmgr == "pacman" ]]; then
|
||||||
|
pacman -Rcns --noconfirm *docker*
|
||||||
|
|
||||||
|
pacman -Sy --noconfirm docker docker-compose &&
|
||||||
|
echo "Success!" &&
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
## Error ##
|
||||||
|
|
||||||
echo "ERROR: Installation failed!"
|
echo "ERROR: Installation failed!"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@ cd $DOCKER_HOME/Config
|
|||||||
for dir in `ls`; do
|
for dir in `ls`; do
|
||||||
[ -d $dir ] && cd $dir || continue
|
[ -d $dir ] && cd $dir || continue
|
||||||
pwd
|
pwd
|
||||||
|
[ -e Dockerfile ] && docker compose build
|
||||||
[ -e docker-compose.yml ] && docker compose up -d
|
[ -e docker-compose.yml ] && docker compose up -d
|
||||||
cd ..
|
cd ..
|
||||||
done
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user