From d7b6876bfcbc9d02f471db93f0eb1e9141edb5cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauri=20V=C3=B5sandi?= Date: Wed, 23 Aug 2023 11:41:12 +0300 Subject: [PATCH] Initial commit --- .github/workflows/docker.yml | 34 ++++++++++++++++++++++++++++++++++ Dockerfile | 8 ++++++++ logging.inc | 2 ++ nginx.conf | 25 +++++++++++++++++++++++++ worker-normal.inc | 1 + 5 files changed, 70 insertions(+) create mode 100644 .github/workflows/docker.yml create mode 100644 Dockerfile create mode 100644 logging.inc create mode 100644 nginx.conf create mode 100644 worker-normal.inc diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..21d0f5a --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,34 @@ +name: ci + +on: + push: + branches: + - "main" + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - + name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ github.repository_owner }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v4 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ github.repository }}:latest diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7ba9cd4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM alpine:3 +RUN apk update \ + && apk add rspamd rspamd-proxy rspamd-utils rspamd-controller nginx \ + && rm -rf /var/cache/apk/* +COPY nginx.conf /etc/nginx/nginx.conf +COPY logging.inc /etc/rspamd/local.d/logging.inc +COPY worker-normal.inc /etc/rspamd/ +CMD /usr/bin/rspamd -f diff --git a/logging.inc b/logging.inc new file mode 100644 index 0000000..a1aac1d --- /dev/null +++ b/logging.inc @@ -0,0 +1,2 @@ +type = console; +level = "notice"; diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..40d39e9 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,25 @@ +worker_processes 1; +pid /var/run/nginx.pid; +error_log /dev/stdout info; + +events { + worker_connections 8192; + use epoll; +} + +http { + include mime.types; + default_type text/plain; + sendfile on; + tcp_nopush on; + tcp_nodelay on; + gzip on; + server { + access_log /dev/stdout; + location / { + alias /usr/share/rspamd/www/; + try_files $uri @proxy; + } + server_tokens off; + } +} diff --git a/worker-normal.inc b/worker-normal.inc new file mode 100644 index 0000000..aac8fc1 --- /dev/null +++ b/worker-normal.inc @@ -0,0 +1 @@ +bind_socket = "*:11333";