Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

Commit

Permalink
add docker mailserver
Browse files Browse the repository at this point in the history
  • Loading branch information
FarisZR committed Feb 2, 2024
1 parent 8719fb6 commit 8f10c96
Show file tree
Hide file tree
Showing 4 changed files with 849 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/docker-mailserver.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: deploy-docker-mailserver

on:
push:
paths:
- '.github/workflows/docker-mailserver.yml'
- 'docker-mailserver/**'
branches: [main]
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: Docker-mailserver
steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Tailscale
uses: tailscale/github-action@7a0b30ed3517c2244d1330e39467b95f067a33bd
with:
oauth-client-id: ${{ secrets.TAILSCALE_CLIENT_ID }}
oauth-secret: ${{ secrets.TAILSCALE_SECRET }}
tags: tag:deploy-ci
hostname: Github-actions
version: ${{ vars.TAILSCALE_VERSION }}

- name: Start Deployment
uses: FarisZR/[email protected]
with:
remote_docker_host: ${{ secrets.server_address }}
tailscale_ssh: true # no need for manual private and public keys
compose_file_path: docker-mailserver/docker-compose.yml
args: -p docker-mailserver up -d --remove-orphans
upload_directory: true
docker_compose_directory: docker-mailserver
48 changes: 48 additions & 0 deletions docker-mailserver/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
networks:
discourse:
external: true

services:
mailserver:
image: ghcr.io/docker-mailserver/docker-mailserver:13.3.1@sha256:33d1dcef8a4e1d9d30f715b82b88c9e99ca16a8c6380c5e40c39b2b7fd710485
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.cups-1.aosus.org
env_file: mailserver.env
# More information about the mail-server ports:
# https://docker-mailserver.github.io/docker-mailserver/latest/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)
- "110:110" # POP3
- "995:995" # POP3 (with TLS)
volumes:
- mail-data:/var/mail
- mail-state:/var/mail-state
- mail-logs:/var/log/mail
- config:/tmp/docker-mailserver
- /etc/localtime:/etc/localtime:ro
- caddy_data:/caddy-data: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
networks:
discourse:

volumes:
mail-data:
mail-state:
mail-logs:
config:
caddy_data:
external: true
Loading

0 comments on commit 8f10c96

Please sign in to comment.