summaryrefslogtreecommitdiff
path: root/Applications
diff options
context:
space:
mode:
authorDaniel Weipert <code@drogueronin.de>2023-09-18 15:56:31 +0200
committerDaniel Weipert <code@drogueronin.de>2023-09-18 15:57:46 +0200
commitb18e29b389792267269c77db711b54d38e6b9d59 (patch)
tree973ad914da9105cc526df1690cc99dc038fea5e4 /Applications
initial commit
Diffstat (limited to 'Applications')
-rw-r--r--Applications/NextCloud/.env.example11
-rw-r--r--Applications/NextCloud/bin/fstab12
-rw-r--r--Applications/NextCloud/docker-compose.yml41
-rw-r--r--Applications/PiHole/.env.example2
-rw-r--r--Applications/PiHole/.env.pihole.example47
-rw-r--r--Applications/PiHole/docker-compose.yml35
-rw-r--r--Applications/PiHole/volumes/pihole/custom.list3
-rw-r--r--Applications/Traefik/.env.example2
-rw-r--r--Applications/Traefik/docker-compose.yml28
9 files changed, 181 insertions, 0 deletions
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}"
diff --git a/Applications/PiHole/.env.example b/Applications/PiHole/.env.example
new file mode 100644
index 0000000..4e95c38
--- /dev/null
+++ b/Applications/PiHole/.env.example
@@ -0,0 +1,2 @@
+DOMAIN=pi.hole.archion.sls19.lan
+TRAEFIK_NETWORK=traefik-public
diff --git a/Applications/PiHole/.env.pihole.example b/Applications/PiHole/.env.pihole.example
new file mode 100644
index 0000000..6c62aab
--- /dev/null
+++ b/Applications/PiHole/.env.pihole.example
@@ -0,0 +1,47 @@
+PIHOLE_IP=
+ROUTER_IP=
+
+TZ=Europe/Berlin
+WEBPASSWORD=
+FTLCONF_LOCAL_IPv4=${PIHOLE_IP}
+
+PIHOLE_DNS_=${ROUTER_IP}
+
+DHCP_ACTIVE=true
+DHCP_START=
+DHCP_END
+
+# Environment Variables documented at: https://github.com/pi-hole/docker-pi-hole/#environment-variables
+
+
+PIHOLE_IP=
+ROUTER_IP=
+
+
+## Recommended
+
+TZ=Europe/Berlin
+WEBPASSWORD=
+FTLCONF_LOCAL_IPV4=${PIHOLE_IP}
+
+
+## Optional
+
+PIHOLE_DNS_=${ROUTER_IP}
+
+DHCP_ACTIVE=true
+DHCP_START=192.168.178.20
+DHCP_END=192.168.178.200
+DHCP_ROUTER=${ROUTER_IP}
+
+WEBTHEME=default-dark
+
+
+## Advanced
+
+#
+
+
+## Experimental
+
+#
diff --git a/Applications/PiHole/docker-compose.yml b/Applications/PiHole/docker-compose.yml
new file mode 100644
index 0000000..b3fbabd
--- /dev/null
+++ b/Applications/PiHole/docker-compose.yml
@@ -0,0 +1,35 @@
+version: "3"
+
+services:
+ pihole:
+ image: "pihole/pihole"
+ container_name: "pihole"
+ restart: "unless-stopped"
+ cap_add:
+ - NET_ADMIN
+ dns:
+ - "127.0.0.1"
+ hostname: "${DOMAIN}"
+ ports:
+ - "53:53/tcp"
+ - "53:53/udp"
+ - "67:67/udp"
+ environment:
+ - "VIRTUAL_HOST=${DOMAIN}"
+ - "DNSMASQ_LISTENING=all"
+ env_file: ".env.pihole"
+ volumes:
+ - "./volumes/pihole/data:/etc/pihole"
+ - "./volumes/pihole/dnsmasq.d:/etc/dnsmasq.d"
+ - "./volumes/pihole/custom.list:/etc/pihole/custom.list"
+ networks:
+ - "traefik"
+ labels:
+ - "traefik.enable=true"
+ - "traefik.http.routers.pihole.rule=Host(`${DOMAIN}`)"
+ - "traefik.http.routers.pihole.entrypoints=web"
+ - "traefik.http.services.pihole.loadbalancer.server.port=80"
+
+networks:
+ traefik:
+ name: "${TRAEFIK_NETWORK}"
diff --git a/Applications/PiHole/volumes/pihole/custom.list b/Applications/PiHole/volumes/pihole/custom.list
new file mode 100644
index 0000000..7e49694
--- /dev/null
+++ b/Applications/PiHole/volumes/pihole/custom.list
@@ -0,0 +1,3 @@
+127.0.0.1 pi.hole.archion.sls19.lan
+127.0.0.1 traefik.archion.sls19.lan
+127.0.0.1 cloud.archion.sls19.lan
diff --git a/Applications/Traefik/.env.example b/Applications/Traefik/.env.example
new file mode 100644
index 0000000..9c0f2a6
--- /dev/null
+++ b/Applications/Traefik/.env.example
@@ -0,0 +1,2 @@
+DOMAIN=traefik.archion.sls19.lan
+NETWORK=traefik-public
diff --git a/Applications/Traefik/docker-compose.yml b/Applications/Traefik/docker-compose.yml
new file mode 100644
index 0000000..b432691
--- /dev/null
+++ b/Applications/Traefik/docker-compose.yml
@@ -0,0 +1,28 @@
+version: "3"
+
+services:
+ traefik:
+ image: "traefik"
+ container_name: "traefik"
+ restart: "always"
+ command:
+ - "--api.insecure=true"
+ - "--entrypoints.web.address=:80"
+ - "--providers.docker=true"
+ - "--providers.docker.exposedbydefault=false"
+ ports:
+ - "80:80"
+ labels:
+ - "traefik.enable=true"
+ # Dashboard
+ - "traefik.http.services.loadbalancer.server.port=8080"
+ - "traefik.http.routers.traefik.rule=Host(`${DOMAIN}`)"
+ - "traefik.http.routers.traefik.entrypoints=web"
+ volumes:
+ - "/var/run/docker.sock:/var/run/docker.sock"
+ networks:
+ - "traefik"
+
+networks:
+ traefik:
+ name: "${NETWORK}"