diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..d4b8df0 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,11 @@ +.git +.github +.gitea +.remember +.env +.env.* +data +logs +mail +spool +*.log diff --git a/.gitea/workflows/docker-build.yml b/.gitea/workflows/docker-build.yml new file mode 100644 index 0000000..a467477 --- /dev/null +++ b/.gitea/workflows/docker-build.yml @@ -0,0 +1,54 @@ +name: Build and Push Docker Image + +on: + push: + branches: [main] + schedule: + - cron: '0 0 1 * *' # Monthly on the first day, at midnight UTC. + workflow_dispatch: + +jobs: + build: + runs-on: kube + if: github.ref == 'refs/heads/main' + env: + DOCKER_BUILD_RECORD_UPLOAD: 'false' + DOCKER_BUILD_SUMMARY: 'false' + steps: + - name: Checkout code + uses: https://github.com/actions/checkout@v4 + with: + persist-credentials: false + + - name: Install Docker CLI + run: | + apt-get update + apt-get install -y --no-install-recommends docker.io + rm -rf /var/lib/apt/lists/* + + - name: Log in to Docker Hub + uses: https://github.com/docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USER }} + password: ${{ secrets.DOCKER_TOKEN }} + + - name: Set up temporary builder + uses: https://github.com/docker/setup-buildx-action@v3 + with: + driver: docker-container + cache-binary: false + keep-state: false + cleanup: true + + - name: Build and push to Docker Hub + uses: https://github.com/docker/build-push-action@v6 + with: + context: . + platforms: linux/amd64 + pull: true + push: true + load: false + tags: docker.io/k2patel/postfix:latest + labels: | + org.opencontainers.image.source=https://git.k2patel.in/k2patel/docker-postfix + org.opencontainers.image.revision=${{ github.sha }} diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml deleted file mode 100644 index 880507e..0000000 --- a/.github/workflows/docker-build.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Build and Push Docker Image - -on: - schedule: - - cron: "0 0 1 * *" # This runs at midnight on the first day of every month - push: - branches: - - main - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Log in to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_TOKEN }} - - - name: Build the Docker image - id: build - run: | - docker build . -t k2patel/postfix:latest - echo "IMAGE_NAME=k2patel/postfix:latest" >> $GITHUB_ENV - - - name: Push the Docker image - run: docker push ${{ env.IMAGE_NAME }} diff --git a/Dockerfile b/Dockerfile index c232170..1bb00e0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,16 @@ -FROM docker.io/library/alpine:3.19 +FROM docker.io/library/alpine:3.24 # Variables for Labels -ARG VENDOR="your-org" +ARG VENDOR="k2patel" ARG COMPONENT="postfix-relay" ARG BUILD_DATE -ARG GIT_REPO="https://github.com/your-org/docker-postfix" +ARG GIT_REPO="https://git.k2patel.in/k2patel/docker-postfix" ARG VCS_REF ARG VERSION="2.0" ARG NAME="dockerized-${COMPONENT}" ARG DESCRIPTION="Postfix SMTP relay supporting multiple providers (Maileroo, Mailtrap, SendGrid)" -ARG DOCUMENTATION="https://github.com/your-org/docker-postfix" -ARG AUTHOR="Your Name " +ARG DOCUMENTATION="https://git.k2patel.in/k2patel/docker-postfix" +ARG AUTHOR="k2patel" ARG LICENSE="MIT" # Labels diff --git a/README.md b/README.md index 9c0c95b..3761ef3 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,9 @@ A lightweight Postfix SMTP relay container supporting multiple email service providers including Maileroo, Mailtrap, SendGrid, and any generic SMTP server. +The image uses Alpine 3.24 (musl libc) and is published as `k2patel/postfix:latest`. +Builds run on Gitea for pushes to `main`, monthly, or by manual dispatch. + ## Features - 🚀 Multi-provider support (Maileroo, Mailtrap, SendGrid, Gmail, Office365, any SMTP) @@ -16,7 +19,7 @@ A lightweight Postfix SMTP relay container supporting multiple email service pro ### 1. Clone and Configure ```bash -git clone https://github.com/your-org/docker-postfix.git +git clone https://git.k2patel.in/k2patel/docker-postfix.git cd docker-postfix cp env.sample .env nano .env # Edit with your SMTP provider details @@ -459,4 +462,4 @@ MIT License - See [LICENSE](LICENSE) file for details. ## Support -For issues and questions, please open an issue on GitHub. \ No newline at end of file +For issues and questions, please open an issue on [Gitea](https://git.k2patel.in/k2patel/docker-postfix/issues).