diff --git a/Config/DNS/docker-compose.standard.yml b/Config/DNS/docker-compose.standard.yml index 8a00d47..0f2c4d4 100644 --- a/Config/DNS/docker-compose.standard.yml +++ b/Config/DNS/docker-compose.standard.yml @@ -5,8 +5,6 @@ # https://thekelleys.org.uk/dnsmasq/doc.html # -version: '3' - services: app: container_name: dns-app diff --git a/Config/Hyperling.com/Dockerfile b/Config/Hyperling.com/Dockerfile index f6c5093..bda16db 100644 --- a/Config/Hyperling.com/Dockerfile +++ b/Config/Hyperling.com/Dockerfile @@ -3,12 +3,18 @@ # Using Debian testing so that we use PHP >8. Otherwise the shebangs from # the include files (#!/usr/bin/php) show up on the website. -FROM debian:testing +FROM node:lts-slim -# Install Dependencies -RUN apt update && apt install -y sudo php-fpm nodejs npm +# Cache System Dependencies +RUN apt-get update && apt-get install -y git php-cli -# Run Website +# Cache Node Dependencies +RUN mkdir -p /var/www/api +WORKDIR /var/www/api +RUN echo '{ "dependencies": { "express": "" } }' > package.json +RUN npm install + +# Install + Run Website CMD cd /var/www/api && \ rm -rfv pages main.js run.sh && \ git clone https://github.com/Hyperling/Website website && \ diff --git a/Config/Hyperling.com/docker-compose.micro.yml b/Config/Hyperling.com/docker-compose.micro.yml index 31e24fe..a3961c1 100644 --- a/Config/Hyperling.com/docker-compose.micro.yml +++ b/Config/Hyperling.com/docker-compose.micro.yml @@ -2,11 +2,9 @@ # Hyperling.com configuration. # 2023-01-24 container needs 128M to get started fully then settles to 25M. -version: '2' - services: app: - container_name: website-app + container_name: www-app build: context: ./ network: host diff --git a/Config/Hyperling.com/docker-compose.standard.yml b/Config/Hyperling.com/docker-compose.standard.yml index bc4b1a2..917e319 100644 --- a/Config/Hyperling.com/docker-compose.standard.yml +++ b/Config/Hyperling.com/docker-compose.standard.yml @@ -1,11 +1,9 @@ # 2022-10-29 # Hyperling.com configuration. -version: '2' - services: app: - container_name: website-app + container_name: www-app build: context: ./ network: host diff --git a/Config/Nextcloud/docker-compose.micro.yml b/Config/Nextcloud/docker-compose.micro.yml index 7daf820..ec88316 100644 --- a/Config/Nextcloud/docker-compose.micro.yml +++ b/Config/Nextcloud/docker-compose.micro.yml @@ -18,8 +18,6 @@ # 2024-01-23 # Experimenting with how small a Nextcloud installation can survive. -version: '3' - services: ## MariaDB ## @@ -74,7 +72,7 @@ services: ## Nextcloud ## nc-app: container_name: nc-app - image: nextcloud + image: nextcloud:stable restart: always ports: - 8080:80 diff --git a/Config/Nextcloud/docker-compose.standard.yml b/Config/Nextcloud/docker-compose.standard.yml index 9b99581..a1cdb6d 100644 --- a/Config/Nextcloud/docker-compose.standard.yml +++ b/Config/Nextcloud/docker-compose.standard.yml @@ -16,8 +16,6 @@ # to maintain and may allow the internal address to be based on container # name instead of the docker hosts's IP. -version: '3' - services: ## MariaDB ## @@ -75,7 +73,7 @@ services: ## Nextcloud ## nc-app: container_name: nc-app - image: nextcloud + image: nextcloud:stable restart: always ports: - 8080:80 diff --git a/Config/PhotoPrism/docker-compose.standard.yml b/Config/PhotoPrism/docker-compose.standard.yml index 18a6172..f5c2dc6 100644 --- a/Config/PhotoPrism/docker-compose.standard.yml +++ b/Config/PhotoPrism/docker-compose.standard.yml @@ -35,8 +35,6 @@ # 2023-09-15: File created and tweaked based on 'https://dl.photoprism.app/docker/docker-compose.yml'. ## -version: '3.5' - services: pp-app: container_name: pp-app diff --git a/Config/ReverseProxy/docker-compose.micro.yml b/Config/ReverseProxy/docker-compose.micro.yml index 136ff50..bd213c4 100644 --- a/Config/ReverseProxy/docker-compose.micro.yml +++ b/Config/ReverseProxy/docker-compose.micro.yml @@ -5,8 +5,6 @@ # https://www.docker.com/blog/how-to-use-the-official-nginx-docker-image/ # https://pentacent.medium.com/nginx-and-lets-encrypt-with-docker-in-less-than-5-minutes-b4b8a60d3a71 -version: '3' - services: app: diff --git a/Config/ReverseProxy/docker-compose.standard.yml b/Config/ReverseProxy/docker-compose.standard.yml index 0b096b5..e36a1b0 100644 --- a/Config/ReverseProxy/docker-compose.standard.yml +++ b/Config/ReverseProxy/docker-compose.standard.yml @@ -5,8 +5,6 @@ # https://www.docker.com/blog/how-to-use-the-official-nginx-docker-image/ # https://pentacent.medium.com/nginx-and-lets-encrypt-with-docker-in-less-than-5-minutes-b4b8a60d3a71 -version: '3' - services: app: diff --git a/bin/pull_backup.example.sh b/bin/pull_backup.example.sh deleted file mode 100755 index c110e7c..0000000 --- a/bin/pull_backup.example.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash -# 2024-01-29 Hyperling -# Example of how to pull the polled Backip.zip file. This would be placed on -# the machine holding the backups in the directory that it should land. - -DIR="$(dirname -- "${BASH_SOURCE[0]}")" -PROG="$(basename -- "${BASH_SOURCE[0]}")" -echo "$DIR/$PROG" - -## Variables ## - -DATE="`date '+%Y%m%d'`" -NEWFILE="$DIR/Backup_${DATE}.zip" -LATEST="`ls $DIR/Backup_*.zip | sort -r | head -n 1`" - -## Main ## - -echo "`date` - Creating '$NEWFILE'." -scp -P 4022 user@example.com:/tmp/Backup.zip $NEWFILE.tmp -mv -v $NEWFILE.tmp $NEWFILE - -## Validation ## - -# TBD: Can make this fancier, such as doing a real comparison for size growth. - -echo "`date` - New backup's size:" -du -h $NEWFILE - -echo "`date` - Previous backup's size:" -du -h $LATEST - -## Finish ## - -exit 0 diff --git a/bin/pull_backup.sh b/bin/pull_backup.sh new file mode 100755 index 0000000..e63c15f --- /dev/null +++ b/bin/pull_backup.sh @@ -0,0 +1,75 @@ +#!/usr/bin/env bash +# 2024-01-29 Hyperling +# Example of how to pull the polled Backip.zip file. This would be placed on +# the machine holding the backups in the directory that it should land. + +DIR="$(dirname -- "${BASH_SOURCE[0]}")" +PROG="$(basename -- "${BASH_SOURCE[0]}")" +echo "$DIR/$PROG" + +## Variables ## + +DATE="`date '+%Y%m%d'`" +NEWFILE="$DIR/Backup_${DATE}.zip" +PREVIOUS="`ls $DIR/Backup_*.zip | sort -r | head -n 1`" + +## Functions ## + +function usage { + echo -e "Usage: $PROG -d DESTINATION [-u USER] [-p PORT] [-h]\n" + cat <<- EOF + Download the latest Backup.zip from a Hyperling/Docker type project. The + file is downloaded to the directory that this file exists in, so that it + can be conveniently kept with the backups themselves. + + Parameters + -d : The server name or IP address running hhe Docker instance. + -u : Username to connect as. Default LOGNAME, currently '$LOGNAME'. + -p : Port to connect through. Defaults to 22. + -h : Display this usage text. + EOF +} + +## Parameters ## + +port=22 +user="$LOGNAME" +while getopts ':d:u:p:h' opt; do + case "$opt" in + d) destination="$OPTARG" ;; + u) user="$OPTARG" ;; + p) port="$OPTARG" ;; + h) usage 0 ;; + *) echo "ERROR: Parameter '$OPTARG' not recognized." >&2 + usage 1 ;; + esac +done + +## Validations ## + +if [[ -z $destination ]]; then + echo "ERROR: Destination was not provided." >&2 + usage 2 +fi + +## Main ## + +echo "`date` - Creating '$NEWFILE'." +scp -P $port "$user@[$destination]":/tmp/Backup.zip $NEWFILE.tmp +mv -v $NEWFILE.tmp $NEWFILE + +## Validation ## + +# TBD: Can make this fancier, such as doing a real comparison for size growth. + +echo "`date` - New backup's size:" +du -h $NEWFILE + +if [[ -n $PREVIOUS ]]; then + echo "`date` - Previous backup's size:" + du -h $PREVIOUS +fi + +## Finish ## + +exit 0 diff --git a/source.env b/source.env index f8b03ea..5e576c7 100755 --- a/source.env +++ b/source.env @@ -24,6 +24,10 @@ export DOCKER_HOME DOCKER_PATH PATH alias manage="$DOCKER_HOME/bin/manage.sh" +alias Docker="cd $DOCKER_HOME" +alias Config="cd $DOCKER_HOME/Config" +alias Volumes="cd $DOCKER_HOME/Volumes" + ## Validations ## if [[ -e $DOCKER_HOME/$PROG ]]; then