From 312eb633916ce335798800417892262d64659cc0 Mon Sep 17 00:00:00 2001 From: Adar Nimrod <nimrod@shore.co.il> Date: Mon, 4 Jan 2021 12:00:12 +0200 Subject: [PATCH] WIP. Installation, cron jobs, surrounding services. Missing configuration and whatnot. --- README.md | 6 ++++++ crond/.dockerignore | 2 ++ crond/Dockerfile | 7 +++++++ crond/crontab | 2 ++ docker-compose.yml | 51 +++++++++++++++++++++++++++++++++++++++++++++ sogo/.dockerignore | 1 + sogo/Dockerfile | 21 +++++++++++++++++++ 7 files changed, 90 insertions(+) create mode 100644 crond/.dockerignore create mode 100644 crond/Dockerfile create mode 100644 crond/crontab create mode 100644 docker-compose.yml create mode 100644 sogo/.dockerignore create mode 100644 sogo/Dockerfile diff --git a/README.md b/README.md index 51727a7..7e841a9 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,12 @@ Dockerized setup of the [SOGo](https://sogo.nu/) groupware. +This a WIP and not ready or in use anywhere. I'm playing around with this +because the mail UI in Nextcloud is poor (for example search times out for me) +and the ActiveSync using z-push fails more than it succeeds. I'm thinking about +replacing the mail UI, calendar, contact, tasks and ActiveSync (the PIM aspects) +with SOGo and removing z-push. + ## License This software is licensed under the MIT license (see `LICENSE.txt`). diff --git a/crond/.dockerignore b/crond/.dockerignore new file mode 100644 index 0000000..780ece0 --- /dev/null +++ b/crond/.dockerignore @@ -0,0 +1,2 @@ +* +!crontab diff --git a/crond/Dockerfile b/crond/Dockerfile new file mode 100644 index 0000000..e554c46 --- /dev/null +++ b/crond/Dockerfile @@ -0,0 +1,7 @@ +# hadolint ignore=DL3006 +FROM registry.hub.docker.com/adarnimrod/cron +# hadolint ignore=DL3018 +RUN apk add --no-cache --update docker-cli +COPY --chown=root:root crontab /crontab +# hadolint ignore=DL3002 +USER root diff --git a/crond/crontab b/crond/crontab new file mode 100644 index 0000000..a356d6f --- /dev/null +++ b/crond/crontab @@ -0,0 +1,2 @@ +*/5 * * * * docker exec -u sogo sogo_sogo_1 /usr/sbin/sogo-ealarms-notify +0 0 * * * docker exec -u sogo sogo_sogo_1 /usr/sbin/sogo-tool update-autoreply -p /etc/sogo/sieve.creds diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..5c9e60c --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,51 @@ +--- +version: "3.7" +services: + crond: + build: + context: crond/ + restart: always + volumes: + - /run/docker.sock:/run/docker.sock + + memcached: + image: registry.hub.docker.com/library/memcached:1.6-alpine + healthcheck: + test: + - CMD-SHELL + - pgrep memcached || exit 1 + restart: always + + postres: + environment: + POSTGRES_PASSWORD: "${POSTGRES_PASSWORD:-foo}" + POSTGRES_USER: sogo + image: registry.hub.docker.com/library/postgres:13-alpine + healthcheck: + test: + - CMD-SHELL + - >- + PGPASSWORD="$${POSTGRES_PASSWORD}" + psql + --host=127.0.0.1 + --username=$${POSTGRES_USER} + --dbname=$${POSTGRES_USER} + --command="SELECT 1;" + || exit 1 + restart: always + volumes: + - postgres:/var/lib/postgresql/data + + sogo: + build: + context: sogo/ + hostname: sogo.shore.co.il + restart: always + +volumes: + postgres: + +networks: + default: + name: shore + external: true diff --git a/sogo/.dockerignore b/sogo/.dockerignore new file mode 100644 index 0000000..72e8ffc --- /dev/null +++ b/sogo/.dockerignore @@ -0,0 +1 @@ +* diff --git a/sogo/Dockerfile b/sogo/Dockerfile new file mode 100644 index 0000000..e8b6852 --- /dev/null +++ b/sogo/Dockerfile @@ -0,0 +1,21 @@ +FROM registry.hub.docker.com/library/debian:buster-slim +# hadolint ignore=DL3008 +RUN apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + apt-transport-https \ + ca-certificates \ + gnupg \ + && \ + apt-key adv --keyserver hkp://keys.gnupg.net --recv-key 0x810273C4 && \ + echo 'deb https://packages.inverse.ca/SOGo/nightly/5/debian/ buster buster' > /etc/apt/sources.list.d/sogo.list && \ + apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + sogo-activesync \ + sogo \ + && \ + rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/* /var/cache/apt/archives/* +EXPOSE 20000 +USER "www-data" +WORKDIR /var/www +CMD [ "apache2", "-DFOREGROUND" ] +HEALTHCHECK CMD wget --spider --quiet http://localhost:20000/ --user-agent 'Healthcheck' || exit 1 -- GitLab