From b18e29b389792267269c77db711b54d38e6b9d59 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Mon, 18 Sep 2023 15:56:31 +0200 Subject: initial commit --- Applications/NextCloud/.env.example | 11 +++++++++ Applications/NextCloud/bin/fstab | 12 +++++++++ Applications/NextCloud/docker-compose.yml | 41 +++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 Applications/NextCloud/.env.example create mode 100644 Applications/NextCloud/bin/fstab create mode 100644 Applications/NextCloud/docker-compose.yml (limited to 'Applications/NextCloud') diff --git a/Applications/NextCloud/.env.example b/Applications/NextCloud/.env.example new file mode 100644 index 0000000..52ae080 --- /dev/null +++ b/Applications/NextCloud/.env.example @@ -0,0 +1,11 @@ +DOMAIN=cloud.archion.sls19.lan +TRAEFIK_NETWORK=traefik-public + +DB_NAME=nextcloud +DB_USER=nextcloud +DB_PASSWORD=nextcloud + +EXTERNAL_STORAGE_PATH_HOST=/media/nextcloud +EXTERNAL_STORAGE_PATH_CONTAINER=/media/nextcloud +EXTERNAL_STORAGE_PARTITION=/dev/X +EXTERNAL_STORAGE_FS_TYPE=fat diff --git a/Applications/NextCloud/bin/fstab b/Applications/NextCloud/bin/fstab new file mode 100644 index 0000000..a804da2 --- /dev/null +++ b/Applications/NextCloud/bin/fstab @@ -0,0 +1,12 @@ +#!/usr/bin/env zsh + +source .env + +if grep -q "${EXTERNAL_STORAGE_PATH_HOST}"; then + echo "Already mounted." + exit +fi + +echo "${EXTERNAL_STORAGE_PARTITION} ${EXTERNAL_STORAGE_PATH_HOST} ${EXTERNAL_STORAGE_FS_TYPE} rw 0 1" >> "/etc/fstab" +mkdir -p "${EXTERNAL_STORAGE_PATH_HOST}" +mount -a -v diff --git a/Applications/NextCloud/docker-compose.yml b/Applications/NextCloud/docker-compose.yml new file mode 100644 index 0000000..c5af0b4 --- /dev/null +++ b/Applications/NextCloud/docker-compose.yml @@ -0,0 +1,41 @@ +version: "3" + +services: + app: + image: "nextcloud" + restart: "unless-stopped" + environment: + - "MYSQL_DATABASE=${DB_NAME}" + - "MYSQL_USER=${DB_USER}" + - "MYSQL_PASSWORD=${DB_PASSWORD}" + - "MYSQL_HOST=db" + volumes: + - "./volumes/nextcloud:/var/www/html" + - "${EXTERNAL_STORAGE_PATH_HOST}:${EXTERNAL_STORAGE_PATH_CONTAINER}" + networks: + - "internal" + - "traefik" + labels: + - "traefik.enable=true" + - "traefik.docker.network=${TRAEFIK_NETWORK}" + - "traefik.http.routers.nextcloud.rule=Host(`${DOMAIN}`)" + - "traefik.http.routers.nextcloud.entrypoints=web" + + db: + image: "mariadb" + restart: "unless-stopped" + command: "--transaction-isolation=READ-COMMITTED --binlog-format=ROW" + environment: + - "MYSQL_DATABASE=${DB_NAME}" + - "MYSQL_USER=${DB_USER}" + - "MYSQL_PASSWORD=${DB_PASSWORD}" + - "MYSQL_ROOT_PASSWORD=${DB_PASSWORD}" + volumes: + - "./volumes/db:/var/lib/mysql" + networks: + - "internal" + +networks: + internal: + traefik: + name: "${TRAEFIK_NETWORK}" -- cgit v1.2.3