From ab2f56975df14584b6c772e77f3f9958e9f81a5e Mon Sep 17 00:00:00 2001 From: Steph Date: Fri, 5 Feb 2021 15:12:31 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=89=20First=20commit!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.example | 9 ++++++++ .gitignore | 2 ++ backup.conf | 20 +++++++++++++++++ crontab | 1 + docker-compose.yml | 55 ++++++++++++++++++++++++++++++++++++++++++++++ readme.md | 5 +++++ 6 files changed, 92 insertions(+) create mode 100644 .env.example create mode 100644 .gitignore create mode 100644 backup.conf create mode 100644 crontab create mode 100644 docker-compose.yml create mode 100644 readme.md diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..c2abddf --- /dev/null +++ b/.env.example @@ -0,0 +1,9 @@ +PASS=longrandomstring + +HOST=example.com +ALLOWED_IPS=add_internal_proxy_ip_here + +SMTP_HOST=mail.example.com +SMTP_EMAIL=cloud@example.com +SMTP_PASS=1234 +SMTP_DOMAIN=example.com diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..161341f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +mnt/ +.env diff --git a/backup.conf b/backup.conf new file mode 100644 index 0000000..1103bbf --- /dev/null +++ b/backup.conf @@ -0,0 +1,20 @@ +## Backup config file for service. To find the syntax for this file, +## take a look at `man duplicity` or the web docs at this url: +## http://duplicity.nongnu.org/vers8/duplicity.1.html#sect9 +## +## Special syntax has been added, a single pound sign line will be +## interpreted like a variable assignment, a line with two pound +## signs will be seen as comments. + + +## This make daily backups, and keep them for one months, making +## incremental backups and doing a full backup once a week. +# RETAIN=2W +# INCREMENT=1W +# INTERVAL=1D + +## We make backups of config, and the files from most apps. +## User storage isn't getting backed up. ++ ** +- **/mnt/nextcloud/data ++ **/mnt/nextcloud/data/appdata_occp6ppq3u73 diff --git a/crontab b/crontab new file mode 100644 index 0000000..7953e81 --- /dev/null +++ b/crontab @@ -0,0 +1 @@ +*/5 * * * * cd ; /usr/local/bin/docker-compose exec -T --user www-data app php -f /var/www/html/cron.php diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..e97f623 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,55 @@ +version: '3' + +services: + db: + image: mariadb + restart: always + command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW + expose: + - 3306 + volumes: + - ./mnt/db:/var/lib/mysql + environment: + - "MYSQL_ROOT_PASSWORD=${PASS}" + - "MYSQL_PASSWORD=${PASS}" + - "MYSQL_DATABASE=nextcloud" + - "MYSQL_USER=nextcloud" + + app: + image: nextcloud + restart: always + depends_on: + - redis + volumes: + - ./mnt/nextcloud:/var/www/html + environment: + - "VIRTUAL_HOST=${HOST}" + - "LETSENCRYPT_HOST=${HOST}" + - "MYSQL_PASSWORD=${PASS}" + - "MYSQL_DATABASE=nextcloud" + - "MYSQL_USER=nextcloud" + - "MYSQL_HOST=db" + - "NEXTCLOUD_ADMIN_USER=admin" + - "NEXTCLOUD_ADMIN_PASSWORD=${PASS}" + - "REDIS_HOST=redis" + - "SMTP_HOST=${SMTP_HOST}" + - "SMTP_SECURE=ssl" + - "SMTP_NAME=${SMTP_EMAIL}" + - "SMTP_PASSWORD=${SMTP_PASS}" + - "MAIL_FROM_ADDRESS=cloud" + - "MAIL_DOMAIN=${SMTP_DOMAIN}" + - "NEXTCLOUD_TRUSTED_DOMAINS=${HOST} ${ALLOWED_IPS}" + networks: + - default + - 10000-nginx-proxy_nginx-proxy + + redis: + image: redis + expose: + - 6379 + depends_on: + - db + +networks: + 10000-nginx-proxy_nginx-proxy: + external: true diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..7b38965 --- /dev/null +++ b/readme.md @@ -0,0 +1,5 @@ +# cloud.steph.tools + +This is the service configuration for the nextcloud instance over at cloud.steph.tools. + +Secrets and config options are kept in `.env`, you can copy `.env.example` to see what you need to fill.