From f77557151a289506cc514ea4b0d14b83b87b719f Mon Sep 17 00:00:00 2001 From: Hyperling Date: Thu, 21 Aug 2025 11:22:24 -0700 Subject: [PATCH 01/33] Add size to container check. --- bin/manage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/manage.sh b/bin/manage.sh index edfda8e..7e82062 100755 --- a/bin/manage.sh +++ b/bin/manage.sh @@ -130,7 +130,7 @@ fi if [[ -z $up && -z $down && -z $build && -z $pull && -z $clean && -z $interact && -z $logs && -z $stats ]]; then - docker ps + docker ps --size exit 0 fi -- 2.49.1 From 606281847571503cc54da960a9a4ac5a62323b78 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Thu, 21 Aug 2025 13:24:53 -0700 Subject: [PATCH 02/33] Add the version of Express as being done in package.json. --- Config/Hyperling.com/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Config/Hyperling.com/Dockerfile b/Config/Hyperling.com/Dockerfile index 29daecd..5e25ec9 100644 --- a/Config/Hyperling.com/Dockerfile +++ b/Config/Hyperling.com/Dockerfile @@ -11,7 +11,7 @@ RUN apt-get update && apt-get install -y git php-cli sudo curl # Cache Node Dependencies RUN mkdir -p /var/www/api WORKDIR /var/www/api -RUN echo '{ "dependencies": { "express": "" } }' > package.json +RUN echo '{ "dependencies": { "express": ">=4.18.1 < 5.0.0" } }' > package.json RUN npm install # Install + Run Website -- 2.49.1 From e1781413574febe2cc7aa7a6a743e97fea8ef8fb Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 22 Aug 2025 13:44:48 -0700 Subject: [PATCH 03/33] Add extra backup locations. Did this a few days ago but it seems it did not get pushed and the commit disappeared. --- bin/backup.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/backup.sh b/bin/backup.sh index 17c82e8..7d3d15e 100755 --- a/bin/backup.sh +++ b/bin/backup.sh @@ -24,8 +24,10 @@ echo -e "\n`date` - Take down services for a cold backup." manage.sh -d echo -e "\n`date` - Create the backup for '$DOCKER_HOME'." -cd $DOCKER_HOME -$time zip -r $file.tmp . 1>/dev/null +$time zip -r $file.tmp \ + $DOCKER_HOME \ + /etc/crontab /etc/cron.d /var/spool/cron \ + /var/{log,mail} 1>/dev/null mv -v $file.tmp $file echo -e "\n`date` - Done with zipping, check size." -- 2.49.1 From 5a5035fd33222964f9c345e057aabca55f97d03e Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 4 Oct 2025 06:34:11 -0700 Subject: [PATCH 04/33] Add `Docker` to Docker backup file. --- bin/backup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/backup.sh b/bin/backup.sh index 7d3d15e..d44e7a6 100755 --- a/bin/backup.sh +++ b/bin/backup.sh @@ -9,7 +9,7 @@ source $DIR/../source.env ## Variables ## -file="/tmp/Backup.zip" +file="/tmp/Backup-Docker.zip" time="`which time`" ## Main ## -- 2.49.1 From 897493dd1fd37a079d43ebab18076ff58bd16c63 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 4 Oct 2025 14:02:17 +0000 Subject: [PATCH 05/33] Fix version of ImageMagickCore for Trixie. --- Config/Nextcloud/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Config/Nextcloud/Dockerfile b/Config/Nextcloud/Dockerfile index 8f105d0..12c2254 100644 --- a/Config/Nextcloud/Dockerfile +++ b/Config/Nextcloud/Dockerfile @@ -4,7 +4,7 @@ FROM nextcloud:stable # Cache System Dependencies -RUN apt-get update && apt-get install -y sudo libmagickcore-6.q16-6-extra htop \ +RUN apt-get update && apt-get install -y sudo libmagickcore-7.q16-10-extra htop \ iputils-ping dnsutils vim bzip2 libbz2-dev # Configure PHP Dependency -- 2.49.1 From 675ac90c310cb81212c10395584998571c283754 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 4 Oct 2025 12:51:30 -0700 Subject: [PATCH 06/33] Stop trying the mysql_upgrade. Add changing row formats to DYNAMIC. --- Config/Nextcloud/maintenance.sh | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/Config/Nextcloud/maintenance.sh b/Config/Nextcloud/maintenance.sh index 39cc526..91212ab 100755 --- a/Config/Nextcloud/maintenance.sh +++ b/Config/Nextcloud/maintenance.sh @@ -35,12 +35,27 @@ $DOCKER_HOME/Config/Nextcloud/cron.sh && echo "Success!" # 2022-10-30 More additions after moving to Nextcloud version 25. echo -e "\n*** DATABASE ***" +echo -e "\n`date` - Enable Maintenance Mode" +docker exec -itu www-data nc-app ./occ maintenance:mode --on + +# 20251004: Disabled since it has not been working. # Clear DB errors by allowing the DB to perform any incremental upgrades. # https://jira.mariadb.org/browse/MDEV-26342 -echo -e "\n`date` - mysql_upgrade" -docker exec -itu www-data nc-app ./occ maintenance:mode --on -time docker exec -it nc-db mysql_upgrade \ - -user="root" --password="$MYSQL_ROOT_PASSWORD" +#echo -e "\n`date` - mysql_upgrade" +#time docker exec -it nc-db mysql_upgrade \ +# -user="root" --password="$MYSQL_ROOT_PASSWORD" + +echo -e "\n`date` - Enable Dynamic Row Formats" +docker exec -it nc-db mysql -u "$MYSQL_USER" -p"$MYSQL_PASSWORD" \ + -e "SELECT CONCAT('ALTER TABLE ', TABLE_NAME,' ROW_FORMAT=DYNAMIC; ') FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = '$MYSQL_DATABASE' AND ENGINE = 'InnoDB' AND ROW_FORMAT != 'DYNAMIC'; " \ + -B -N | +while read -r sql; do + echo "SQL being executed: $sql " + docker exec nc-db mysql -u "$MYSQL_USER" -p"$MYSQL_PASSWORD" -e "$sql" "$MYSQL_DATABASE"; + echo " - Done!\ " +done + +echo -e "\n`date` - Disable Maintenance Mode" docker exec -itu www-data nc-app ./occ maintenance:mode --off echo -e "\n`date` - Add Missing Columns" -- 2.49.1 From 1e665a40b77f2839761c4b4f37e1fa1bc95a548c Mon Sep 17 00:00:00 2001 From: Hyperling Date: Thu, 9 Oct 2025 07:37:14 -0700 Subject: [PATCH 07/33] Add date and hostname to backup file. Delete previous dates. --- bin/backup.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/backup.sh b/bin/backup.sh index d44e7a6..363b7f8 100755 --- a/bin/backup.sh +++ b/bin/backup.sh @@ -9,7 +9,9 @@ source $DIR/../source.env ## Variables ## -file="/tmp/Backup-Docker.zip" +DATE="`date "+%Y%m%d"`" +BASENAME="/tmp/Backup-Docker" +file="$BASENAME.$DATE.$HOSTNAME.zip" time="`which time`" ## Main ## @@ -17,7 +19,7 @@ time="`which time`" # Remove the last backup. if [[ -e $file ]]; then echo "`date` - Removing existing file." - rm -fv $file + rm -fv "$BASENAME"* fi echo -e "\n`date` - Take down services for a cold backup." -- 2.49.1 From 51d6d32790d6d4b2d2713f6c87c71f688ff2a05c Mon Sep 17 00:00:00 2001 From: Hyperling Date: Thu, 9 Oct 2025 07:47:03 -0700 Subject: [PATCH 08/33] Change order of backup wording. Add timestamp. --- bin/backup.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/backup.sh b/bin/backup.sh index 363b7f8..93abb42 100755 --- a/bin/backup.sh +++ b/bin/backup.sh @@ -9,9 +9,10 @@ source $DIR/../source.env ## Variables ## -DATE="`date "+%Y%m%d"`" -BASENAME="/tmp/Backup-Docker" -file="$BASENAME.$DATE.$HOSTNAME.zip" +TAG="Docker" +DATE="`date "+%Y%m%d_%H%M%S"`" +BASENAME="/tmp/Backup" +file="$BASENAME.$DATE.$HOSTNAME.$TAG.zip" time="`which time`" ## Main ## @@ -19,7 +20,7 @@ time="`which time`" # Remove the last backup. if [[ -e $file ]]; then echo "`date` - Removing existing file." - rm -fv "$BASENAME"* + rm -fv "$BASENAME"*"$TAG"* fi echo -e "\n`date` - Take down services for a cold backup." -- 2.49.1 From 4acbd4738802e6389b4f70bd3e9f2c18493adc55 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Thu, 9 Oct 2025 07:50:08 -0700 Subject: [PATCH 09/33] Change separating symbols to match System backup formatting. --- bin/backup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/backup.sh b/bin/backup.sh index 93abb42..80e7cf4 100755 --- a/bin/backup.sh +++ b/bin/backup.sh @@ -10,7 +10,7 @@ source $DIR/../source.env ## Variables ## TAG="Docker" -DATE="`date "+%Y%m%d_%H%M%S"`" +DATE="`date "+%Y%m%d-%H%M%S"`" BASENAME="/tmp/Backup" file="$BASENAME.$DATE.$HOSTNAME.$TAG.zip" time="`which time`" -- 2.49.1 From bde78a14897a0d95e0ddcbbab8094498a28ac23a Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 10 Oct 2025 14:28:01 -0700 Subject: [PATCH 10/33] Create files for testing Ansible script on other distros. --- Config/ProvisionTests/README.md | 3 +++ Config/ProvisionTests/docker-compose.standard.yml | 0 Config/ProvisionTests/env.standard | 0 Config/ProvisionTests/prep.sh | 0 4 files changed, 3 insertions(+) create mode 100644 Config/ProvisionTests/README.md create mode 100644 Config/ProvisionTests/docker-compose.standard.yml create mode 100644 Config/ProvisionTests/env.standard create mode 100644 Config/ProvisionTests/prep.sh diff --git a/Config/ProvisionTests/README.md b/Config/ProvisionTests/README.md new file mode 100644 index 0000000..f0a9c4f --- /dev/null +++ b/Config/ProvisionTests/README.md @@ -0,0 +1,3 @@ +# Provision Test Images + +Create containers of popular Linux distributions in order to test Ansible. diff --git a/Config/ProvisionTests/docker-compose.standard.yml b/Config/ProvisionTests/docker-compose.standard.yml new file mode 100644 index 0000000..e69de29 diff --git a/Config/ProvisionTests/env.standard b/Config/ProvisionTests/env.standard new file mode 100644 index 0000000..e69de29 diff --git a/Config/ProvisionTests/prep.sh b/Config/ProvisionTests/prep.sh new file mode 100644 index 0000000..e69de29 -- 2.49.1 From 9381d61d99b4058a37d13c6062656123ea89eddc Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 10 Oct 2025 16:07:17 -0700 Subject: [PATCH 11/33] Progress on testing provisioning on multiple distros. So far Debian and Ubuntu are working. Others need packages added. --- Config/ProvisionTests/Dockerfiles/arch | 12 ++ Config/ProvisionTests/Dockerfiles/debian | 12 ++ Config/ProvisionTests/Dockerfiles/fedora | 12 ++ Config/ProvisionTests/Dockerfiles/opensuse | 14 ++ Config/ProvisionTests/Dockerfiles/ubuntu | 12 ++ Config/ProvisionTests/bin/main.sh | 21 +++ .../docker-compose.standard.yml | 136 ++++++++++++++++++ Config/ProvisionTests/env.standard | 16 +++ Config/ProvisionTests/prep.sh | 23 +++ 9 files changed, 258 insertions(+) create mode 100644 Config/ProvisionTests/Dockerfiles/arch create mode 100644 Config/ProvisionTests/Dockerfiles/debian create mode 100644 Config/ProvisionTests/Dockerfiles/fedora create mode 100644 Config/ProvisionTests/Dockerfiles/opensuse create mode 100644 Config/ProvisionTests/Dockerfiles/ubuntu create mode 100644 Config/ProvisionTests/bin/main.sh mode change 100644 => 100755 Config/ProvisionTests/prep.sh diff --git a/Config/ProvisionTests/Dockerfiles/arch b/Config/ProvisionTests/Dockerfiles/arch new file mode 100644 index 0000000..c560724 --- /dev/null +++ b/Config/ProvisionTests/Dockerfiles/arch @@ -0,0 +1,12 @@ +# Create a VM for testing Ansible provisioning. + +FROM archlinux:base + +RUN pacman -Syu --noconfirm && pacman -Sy --noconfirm git bash curl sudo + +COPY bin/main.sh /root/main.sh +RUN chmod +x /root/main.sh + +WORKDIR /root/ +USER root +CMD ./main.sh diff --git a/Config/ProvisionTests/Dockerfiles/debian b/Config/ProvisionTests/Dockerfiles/debian new file mode 100644 index 0000000..c02e668 --- /dev/null +++ b/Config/ProvisionTests/Dockerfiles/debian @@ -0,0 +1,12 @@ +# Create a VM for testing Ansible provisioning. + +FROM debian:trixie + +RUN apt update && apt dist-upgrade -y && apt install -y git bash curl sudo + +COPY bin/main.sh /root/main.sh +RUN chmod +x /root/main.sh + +WORKDIR /root/ +USER root +CMD ./main.sh diff --git a/Config/ProvisionTests/Dockerfiles/fedora b/Config/ProvisionTests/Dockerfiles/fedora new file mode 100644 index 0000000..649eeb8 --- /dev/null +++ b/Config/ProvisionTests/Dockerfiles/fedora @@ -0,0 +1,12 @@ +# Create a VM for testing Ansible provisioning. + +FROM fedora:latest + +RUN dnf upgrade --refresh -y && dnf install -y git bash curl sudo + +COPY bin/main.sh /root/main.sh +RUN chmod +x /root/main.sh + +WORKDIR /root/ +USER root +CMD ./main.sh diff --git a/Config/ProvisionTests/Dockerfiles/opensuse b/Config/ProvisionTests/Dockerfiles/opensuse new file mode 100644 index 0000000..a4d45cb --- /dev/null +++ b/Config/ProvisionTests/Dockerfiles/opensuse @@ -0,0 +1,14 @@ +# Create a VM for testing Ansible provisioning. + +FROM opensuse/tumbleweed + +RUN zypper -n refresh \ + && zypper -n dist-upgrade -y \ + && zypper -n install -y git bash curl sudo + +COPY bin/main.sh /root/main.sh +RUN chmod +x /root/main.sh + +WORKDIR /root/ +USER root +CMD ./main.sh diff --git a/Config/ProvisionTests/Dockerfiles/ubuntu b/Config/ProvisionTests/Dockerfiles/ubuntu new file mode 100644 index 0000000..4bc69a6 --- /dev/null +++ b/Config/ProvisionTests/Dockerfiles/ubuntu @@ -0,0 +1,12 @@ +# Create a VM for testing Ansible provisioning. + +FROM ubuntu:rolling + +RUN apt update && apt dist-upgrade -y && apt install -y git bash curl sudo + +COPY bin/main.sh /root/main.sh +RUN chmod +x /root/main.sh + +WORKDIR /root/ +USER root +CMD ./main.sh diff --git a/Config/ProvisionTests/bin/main.sh b/Config/ProvisionTests/bin/main.sh new file mode 100644 index 0000000..b7986a4 --- /dev/null +++ b/Config/ProvisionTests/bin/main.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +sh -c "rm -rfv prov-test" +git clone $REPO --branch=$BRANCH prov-test + +cd prov-test + +echo "Starting Executable Script" + +tail -F /var/mail/mail & +tail -F /var/mail/ansible & + +logfile="/root/test.log" +$EXEC > $logfile & +tail -F $logfile + +echo "*** Finished $0 @ `date` ***" + +wait -n + +exit $? diff --git a/Config/ProvisionTests/docker-compose.standard.yml b/Config/ProvisionTests/docker-compose.standard.yml index e69de29..20f9054 100644 --- a/Config/ProvisionTests/docker-compose.standard.yml +++ b/Config/ProvisionTests/docker-compose.standard.yml @@ -0,0 +1,136 @@ +# Create containers which each execute a provisioning script and exit. + +volumes: + + pt-storage: + driver: local + driver_opts: + type: none + device: $PT_STORAGE_DIR + o: bind + +services: + + pt-arch: + container_name: pt-arch + build: + context: ./ + dockerfile: Dockerfiles/arch + network: host + restart: no + environment: + - REPO=$REPO + - BRANCH=$BRANCH + - EXEC=$EXEC + volumes: + - type: volume + source: pt-storage + target: /root + volume: + subpath: arch + deploy: + mode: global + resources: + limits: + cpus: $CPU + memory: $RAM + + + pt-debian: + container_name: pt-debian + build: + context: ./ + dockerfile: Dockerfiles/debian + network: host + restart: no + environment: + - REPO=$REPO + - BRANCH=$BRANCH + - EXEC=$EXEC + volumes: + - type: volume + source: pt-storage + target: /root + volume: + subpath: debian + deploy: + mode: global + resources: + limits: + cpus: $CPU + memory: $RAM + + + pt-ubuntu: + container_name: pt-ubuntu + build: + context: ./ + dockerfile: Dockerfiles/ubuntu + network: host + restart: no + environment: + - REPO=$REPO + - BRANCH=$BRANCH + - EXEC=$EXEC + volumes: + - type: volume + source: pt-storage + target: /root + volume: + subpath: ubuntu + deploy: + mode: global + resources: + limits: + cpus: $CPU + memory: $RAM + + + pt-fedora: + container_name: pt-fedora + build: + context: ./ + dockerfile: Dockerfiles/fedora + network: host + restart: no + environment: + - REPO=$REPO + - BRANCH=$BRANCH + - EXEC=$EXEC + volumes: + - type: volume + source: pt-storage + target: /root + volume: + subpath: fedora + deploy: + mode: global + resources: + limits: + cpus: $CPU + memory: $RAM + + + pt-opensuse: + container_name: pt-opensuse + build: + context: ./ + dockerfile: Dockerfiles/opensuse + network: host + restart: no + environment: + - REPO=$REPO + - BRANCH=$BRANCH + - EXEC=$EXEC + volumes: + - type: volume + source: pt-storage + target: /root + volume: + subpath: opensuse + deploy: + mode: global + resources: + limits: + cpus: $CPU + memory: $RAM diff --git a/Config/ProvisionTests/env.standard b/Config/ProvisionTests/env.standard index e69de29..89552c0 100644 --- a/Config/ProvisionTests/env.standard +++ b/Config/ProvisionTests/env.standard @@ -0,0 +1,16 @@ +# This file should be renamed '.env' and have any private values modified. + +COMPOSE_BAKE=true + +## Performance +CPU=0.2 +RAM=0.2G + +## Storage +#STORAGE_DIR=../../Volumes/ProvisionTests +PT_STORAGE_DIR=/tmp/ProvisionTests + +## Script +REPO=https://git.hyperling.com/me/env-ansible +BRANCH=dev +EXEC="./setup.sh -l" diff --git a/Config/ProvisionTests/prep.sh b/Config/ProvisionTests/prep.sh old mode 100644 new mode 100755 index e69de29..4d43806 --- a/Config/ProvisionTests/prep.sh +++ b/Config/ProvisionTests/prep.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +# 2025-07-22 Hyperling +# Create the necessary folders for LibreTranslate's volumes to work. +# This must be run before the container will start properly. + +## Setup ## + +DIR="$(dirname -- "${BASH_SOURCE[0]}")" +source $DIR/.env +source ../../source.env + +## Main ## + +# Create folders. + +mkdir -pv "$PT_STORAGE_DIR/arch" +mkdir -pv "$PT_STORAGE_DIR/debian" +mkdir -pv "$PT_STORAGE_DIR/fedora" +mkdir -pv "$PT_STORAGE_DIR/ubuntu" +mkdir -pv "$PT_STORAGE_DIR/opensuse" + +# Finish successfully. +exit 0 -- 2.49.1 From f57a0d322db5620b9d555e9124ac31ba73959136 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 10 Oct 2025 16:08:58 -0700 Subject: [PATCH 12/33] Add `which` to install commands. --- Config/ProvisionTests/Dockerfiles/arch | 2 +- Config/ProvisionTests/Dockerfiles/debian | 2 +- Config/ProvisionTests/Dockerfiles/fedora | 2 +- Config/ProvisionTests/Dockerfiles/opensuse | 2 +- Config/ProvisionTests/Dockerfiles/ubuntu | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Config/ProvisionTests/Dockerfiles/arch b/Config/ProvisionTests/Dockerfiles/arch index c560724..9240ca2 100644 --- a/Config/ProvisionTests/Dockerfiles/arch +++ b/Config/ProvisionTests/Dockerfiles/arch @@ -2,7 +2,7 @@ FROM archlinux:base -RUN pacman -Syu --noconfirm && pacman -Sy --noconfirm git bash curl sudo +RUN pacman -Syu --noconfirm && pacman -Sy --noconfirm git bash curl sudo which COPY bin/main.sh /root/main.sh RUN chmod +x /root/main.sh diff --git a/Config/ProvisionTests/Dockerfiles/debian b/Config/ProvisionTests/Dockerfiles/debian index c02e668..33493eb 100644 --- a/Config/ProvisionTests/Dockerfiles/debian +++ b/Config/ProvisionTests/Dockerfiles/debian @@ -2,7 +2,7 @@ FROM debian:trixie -RUN apt update && apt dist-upgrade -y && apt install -y git bash curl sudo +RUN apt update && apt dist-upgrade -y && apt install -y git bash curl sudo which COPY bin/main.sh /root/main.sh RUN chmod +x /root/main.sh diff --git a/Config/ProvisionTests/Dockerfiles/fedora b/Config/ProvisionTests/Dockerfiles/fedora index 649eeb8..0a1b69a 100644 --- a/Config/ProvisionTests/Dockerfiles/fedora +++ b/Config/ProvisionTests/Dockerfiles/fedora @@ -2,7 +2,7 @@ FROM fedora:latest -RUN dnf upgrade --refresh -y && dnf install -y git bash curl sudo +RUN dnf upgrade --refresh -y && dnf install -y git bash curl sudo which COPY bin/main.sh /root/main.sh RUN chmod +x /root/main.sh diff --git a/Config/ProvisionTests/Dockerfiles/opensuse b/Config/ProvisionTests/Dockerfiles/opensuse index a4d45cb..5c08b9f 100644 --- a/Config/ProvisionTests/Dockerfiles/opensuse +++ b/Config/ProvisionTests/Dockerfiles/opensuse @@ -4,7 +4,7 @@ FROM opensuse/tumbleweed RUN zypper -n refresh \ && zypper -n dist-upgrade -y \ - && zypper -n install -y git bash curl sudo + && zypper -n install -y git bash curl sudo which COPY bin/main.sh /root/main.sh RUN chmod +x /root/main.sh diff --git a/Config/ProvisionTests/Dockerfiles/ubuntu b/Config/ProvisionTests/Dockerfiles/ubuntu index 4bc69a6..8238494 100644 --- a/Config/ProvisionTests/Dockerfiles/ubuntu +++ b/Config/ProvisionTests/Dockerfiles/ubuntu @@ -2,7 +2,7 @@ FROM ubuntu:rolling -RUN apt update && apt dist-upgrade -y && apt install -y git bash curl sudo +RUN apt update && apt dist-upgrade -y && apt install -y git bash curl sudo which COPY bin/main.sh /root/main.sh RUN chmod +x /root/main.sh -- 2.49.1 From 7abe909cdfbd70ec1e8c66661bc3153314896554 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 13 Oct 2025 05:31:57 -0700 Subject: [PATCH 13/33] Move packages to env file and allow extras per distro. --- Config/ProvisionTests/Dockerfiles/arch | 2 +- Config/ProvisionTests/Dockerfiles/debian | 2 +- Config/ProvisionTests/Dockerfiles/fedora | 2 +- Config/ProvisionTests/Dockerfiles/opensuse | 2 +- Config/ProvisionTests/Dockerfiles/ubuntu | 2 +- .../docker-compose.standard.yml | 62 ++++++++++--------- Config/ProvisionTests/env.standard | 8 +++ 7 files changed, 47 insertions(+), 33 deletions(-) diff --git a/Config/ProvisionTests/Dockerfiles/arch b/Config/ProvisionTests/Dockerfiles/arch index 9240ca2..3a0cc8a 100644 --- a/Config/ProvisionTests/Dockerfiles/arch +++ b/Config/ProvisionTests/Dockerfiles/arch @@ -2,7 +2,7 @@ FROM archlinux:base -RUN pacman -Syu --noconfirm && pacman -Sy --noconfirm git bash curl sudo which +RUN pacman -Syu --noconfirm && pacman -Sy --noconfirm $PACKAGES $EXTRA_ARCH COPY bin/main.sh /root/main.sh RUN chmod +x /root/main.sh diff --git a/Config/ProvisionTests/Dockerfiles/debian b/Config/ProvisionTests/Dockerfiles/debian index 33493eb..d263f58 100644 --- a/Config/ProvisionTests/Dockerfiles/debian +++ b/Config/ProvisionTests/Dockerfiles/debian @@ -2,7 +2,7 @@ FROM debian:trixie -RUN apt update && apt dist-upgrade -y && apt install -y git bash curl sudo which +RUN apt update && apt dist-upgrade -y && apt install -y $PACKAGES $EXTRA_DEBIAN COPY bin/main.sh /root/main.sh RUN chmod +x /root/main.sh diff --git a/Config/ProvisionTests/Dockerfiles/fedora b/Config/ProvisionTests/Dockerfiles/fedora index 0a1b69a..5bacd24 100644 --- a/Config/ProvisionTests/Dockerfiles/fedora +++ b/Config/ProvisionTests/Dockerfiles/fedora @@ -2,7 +2,7 @@ FROM fedora:latest -RUN dnf upgrade --refresh -y && dnf install -y git bash curl sudo which +RUN dnf upgrade --refresh -y && dnf install -y $PACKAGES $EXTRA_FEDORA COPY bin/main.sh /root/main.sh RUN chmod +x /root/main.sh diff --git a/Config/ProvisionTests/Dockerfiles/opensuse b/Config/ProvisionTests/Dockerfiles/opensuse index 5c08b9f..45296b2 100644 --- a/Config/ProvisionTests/Dockerfiles/opensuse +++ b/Config/ProvisionTests/Dockerfiles/opensuse @@ -4,7 +4,7 @@ FROM opensuse/tumbleweed RUN zypper -n refresh \ && zypper -n dist-upgrade -y \ - && zypper -n install -y git bash curl sudo which + && zypper -n install -y $PACKAGES $EXTRA_OPENSUSE COPY bin/main.sh /root/main.sh RUN chmod +x /root/main.sh diff --git a/Config/ProvisionTests/Dockerfiles/ubuntu b/Config/ProvisionTests/Dockerfiles/ubuntu index 8238494..235ea51 100644 --- a/Config/ProvisionTests/Dockerfiles/ubuntu +++ b/Config/ProvisionTests/Dockerfiles/ubuntu @@ -2,7 +2,7 @@ FROM ubuntu:rolling -RUN apt update && apt dist-upgrade -y && apt install -y git bash curl sudo which +RUN apt update && apt dist-upgrade -y && apt install -y $PACKAGES $EXTRA_UBUNTU COPY bin/main.sh /root/main.sh RUN chmod +x /root/main.sh diff --git a/Config/ProvisionTests/docker-compose.standard.yml b/Config/ProvisionTests/docker-compose.standard.yml index 20f9054..4f59f61 100644 --- a/Config/ProvisionTests/docker-compose.standard.yml +++ b/Config/ProvisionTests/docker-compose.standard.yml @@ -19,6 +19,8 @@ services: network: host restart: no environment: + - PACKAGES=$PACKAGES + - EXTRA_ARCH=$EXTRA_ARCH - REPO=$REPO - BRANCH=$BRANCH - EXEC=$EXEC @@ -35,7 +37,6 @@ services: cpus: $CPU memory: $RAM - pt-debian: container_name: pt-debian build: @@ -44,6 +45,8 @@ services: network: host restart: no environment: + - PACKAGES=$PACKAGES + - EXTRA_DEBIAN=$EXTRA_DEBIAN - REPO=$REPO - BRANCH=$BRANCH - EXEC=$EXEC @@ -60,32 +63,6 @@ services: cpus: $CPU memory: $RAM - - pt-ubuntu: - container_name: pt-ubuntu - build: - context: ./ - dockerfile: Dockerfiles/ubuntu - network: host - restart: no - environment: - - REPO=$REPO - - BRANCH=$BRANCH - - EXEC=$EXEC - volumes: - - type: volume - source: pt-storage - target: /root - volume: - subpath: ubuntu - deploy: - mode: global - resources: - limits: - cpus: $CPU - memory: $RAM - - pt-fedora: container_name: pt-fedora build: @@ -94,6 +71,8 @@ services: network: host restart: no environment: + - PACKAGES=$PACKAGES + - EXTRA_FEDORA=$EXTRA_FEDORA - REPO=$REPO - BRANCH=$BRANCH - EXEC=$EXEC @@ -110,7 +89,6 @@ services: cpus: $CPU memory: $RAM - pt-opensuse: container_name: pt-opensuse build: @@ -119,6 +97,8 @@ services: network: host restart: no environment: + - PACKAGES=$PACKAGES + - EXTRA_OPENSUSE=$EXTRA_OPENSUSE - REPO=$REPO - BRANCH=$BRANCH - EXEC=$EXEC @@ -134,3 +114,29 @@ services: limits: cpus: $CPU memory: $RAM + + pt-ubuntu: + container_name: pt-ubuntu + build: + context: ./ + dockerfile: Dockerfiles/ubuntu + network: host + restart: no + environment: + - PACKAGES=$PACKAGES + - EXTRA_UBUNTU=$EXTRA_UBUNTU + - REPO=$REPO + - BRANCH=$BRANCH + - EXEC=$EXEC + volumes: + - type: volume + source: pt-storage + target: /root + volume: + subpath: ubuntu + deploy: + mode: global + resources: + limits: + cpus: $CPU + memory: $RAM diff --git a/Config/ProvisionTests/env.standard b/Config/ProvisionTests/env.standard index 89552c0..46d730d 100644 --- a/Config/ProvisionTests/env.standard +++ b/Config/ProvisionTests/env.standard @@ -10,6 +10,14 @@ RAM=0.2G #STORAGE_DIR=../../Volumes/ProvisionTests PT_STORAGE_DIR=/tmp/ProvisionTests +## Packages +PACKAGES="git bash curl sudo which" +EXTRA_ARCH="" +EXTRA_DEBIAN="" +EXTRA_FEDORA="" +EXTRA_OPENSUSE="" +EXTRA_UBUNTU="" + ## Script REPO=https://git.hyperling.com/me/env-ansible BRANCH=dev -- 2.49.1 From ce111d01f3bd3e397681b3687a6f9e439bd97a37 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 13 Oct 2025 05:32:14 -0700 Subject: [PATCH 14/33] Chnage order of distros to alphabetical. --- Config/ProvisionTests/prep.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Config/ProvisionTests/prep.sh b/Config/ProvisionTests/prep.sh index 4d43806..bad6517 100755 --- a/Config/ProvisionTests/prep.sh +++ b/Config/ProvisionTests/prep.sh @@ -16,8 +16,8 @@ source ../../source.env mkdir -pv "$PT_STORAGE_DIR/arch" mkdir -pv "$PT_STORAGE_DIR/debian" mkdir -pv "$PT_STORAGE_DIR/fedora" -mkdir -pv "$PT_STORAGE_DIR/ubuntu" mkdir -pv "$PT_STORAGE_DIR/opensuse" +mkdir -pv "$PT_STORAGE_DIR/ubuntu" # Finish successfully. exit 0 -- 2.49.1 From 2697645abe0a6d900623d264eb9dbfea31133f74 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 14 Oct 2025 06:43:54 -0700 Subject: [PATCH 15/33] Properly check if other backups exist. --- bin/backup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/backup.sh b/bin/backup.sh index 80e7cf4..8bbbc5c 100755 --- a/bin/backup.sh +++ b/bin/backup.sh @@ -18,7 +18,7 @@ time="`which time`" ## Main ## # Remove the last backup. -if [[ -e $file ]]; then +if [[ -e "$BASENAME"*"$TAG"* ]]; then echo "`date` - Removing existing file." rm -fv "$BASENAME"*"$TAG"* fi -- 2.49.1 From c138fe67d6d5020250a9e53faa9b93df4cee380c Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 14 Oct 2025 06:55:42 -0700 Subject: [PATCH 16/33] No need for the if, just remove any files that match the pattern. --- bin/backup.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bin/backup.sh b/bin/backup.sh index 8bbbc5c..8daf237 100755 --- a/bin/backup.sh +++ b/bin/backup.sh @@ -18,10 +18,8 @@ time="`which time`" ## Main ## # Remove the last backup. -if [[ -e "$BASENAME"*"$TAG"* ]]; then - echo "`date` - Removing existing file." - rm -fv "$BASENAME"*"$TAG"* -fi +echo "`date` - Removing existing files." +rm -fv "$BASENAME"*"$TAG"* echo -e "\n`date` - Take down services for a cold backup." manage.sh -d -- 2.49.1 From c070d7cb92856a2eaf11a32b88ac3069b5956249 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 14 Oct 2025 07:02:13 -0700 Subject: [PATCH 17/33] Use a dedicated backup directory rather than /tmp. --- bin/backup.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/backup.sh b/bin/backup.sh index 8daf237..6e50171 100755 --- a/bin/backup.sh +++ b/bin/backup.sh @@ -11,12 +11,18 @@ source $DIR/../source.env TAG="Docker" DATE="`date "+%Y%m%d-%H%M%S"`" -BASENAME="/tmp/Backup" +BACKUP_DIR="/srv/backups" +BASENAME="$BACKUP_DIR/Backup" file="$BASENAME.$DATE.$HOSTNAME.$TAG.zip" time="`which time`" ## Main ## +# Ensure backup directory exists with correct permissions. +mkdir -pv $BACKUP_DIR +chmod -Rv 755 $BACKUP_DIR +chown -Rv root:root $BACKUP_DIR + # Remove the last backup. echo "`date` - Removing existing files." rm -fv "$BASENAME"*"$TAG"* -- 2.49.1 From a5a80276ac77b0c04bdbeab9e053197d8843d92e Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 14 Oct 2025 07:07:07 -0700 Subject: [PATCH 18/33] Folder name should not be plural. --- bin/backup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/backup.sh b/bin/backup.sh index 6e50171..414e597 100755 --- a/bin/backup.sh +++ b/bin/backup.sh @@ -11,7 +11,7 @@ source $DIR/../source.env TAG="Docker" DATE="`date "+%Y%m%d-%H%M%S"`" -BACKUP_DIR="/srv/backups" +BACKUP_DIR="/srv/backup" BASENAME="$BACKUP_DIR/Backup" file="$BASENAME.$DATE.$HOSTNAME.$TAG.zip" time="`which time`" -- 2.49.1 From d9f8318e66522c169778a400b44d221baffa9dcc Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 14 Oct 2025 07:12:59 -0700 Subject: [PATCH 19/33] Add recommendation to use /opt/ for LibreTranslate models. --- Config/LibreTranslate/env.example | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Config/LibreTranslate/env.example b/Config/LibreTranslate/env.example index 6c1792c..309f2f7 100644 --- a/Config/LibreTranslate/env.example +++ b/Config/LibreTranslate/env.example @@ -47,3 +47,7 @@ MODELS_DIR=../../Volumes/LibreTranslate/models ## them from backup type locations such as Volumes/LibreTranslate/ and /var/. ## Please see the README for the CRON command related to this setting. # MODELS_DIR=/tmp/LibreTranslate/models + +## Can also place them under /opt/ which may be recommended by FHS standards. +## This keeps them from taking up precious RAM / swap if using tmpfs or similar. +# MODELS_DIR=/opt/LibreTranslate/models -- 2.49.1 From d7820ed373837ec223f6ff3fa9f8579fb8803dd7 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 14 Oct 2025 08:12:57 -0700 Subject: [PATCH 20/33] Add safeties to backup script. --- bin/backup.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bin/backup.sh b/bin/backup.sh index 414e597..74f0c4a 100755 --- a/bin/backup.sh +++ b/bin/backup.sh @@ -19,13 +19,15 @@ time="`which time`" ## Main ## # Ensure backup directory exists with correct permissions. -mkdir -pv $BACKUP_DIR -chmod -Rv 755 $BACKUP_DIR -chown -Rv root:root $BACKUP_DIR +mkdir -pv "$BACKUP_DIR" +chmod -Rv 755 "$BACKUP_DIR" +chown -Rv root:root "$BACKUP_DIR" +cd "$BACKUP_DIR" # Remove the last backup. echo "`date` - Removing existing files." -rm -fv "$BASENAME"*"$TAG"* +mv -v "$BASENAME"*"$TAG"* ~/TRASH/ +rm -v ~/TRASH/"${BASENAME}*${TAG}*.zip" echo -e "\n`date` - Take down services for a cold backup." manage.sh -d -- 2.49.1 From c4032b5b9446ffd517f1a949a700e2d95880af50 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 14 Oct 2025 08:14:49 -0700 Subject: [PATCH 21/33] Remove directory from basename variable. --- bin/backup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/backup.sh b/bin/backup.sh index 74f0c4a..14e67af 100755 --- a/bin/backup.sh +++ b/bin/backup.sh @@ -12,8 +12,8 @@ source $DIR/../source.env TAG="Docker" DATE="`date "+%Y%m%d-%H%M%S"`" BACKUP_DIR="/srv/backup" -BASENAME="$BACKUP_DIR/Backup" -file="$BASENAME.$DATE.$HOSTNAME.$TAG.zip" +BASENAME="Backup" +file="$BACKUP_DIR/$BASENAME.$DATE.$HOSTNAME.$TAG.zip" time="`which time`" ## Main ## -- 2.49.1 From 75711c6c20e7d8cc12a51785bee777460325a60f Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 14 Oct 2025 08:35:23 -0700 Subject: [PATCH 22/33] Ensure backup's TRASH folder gets created and used properly. --- bin/backup.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/backup.sh b/bin/backup.sh index 14e67af..3037a35 100755 --- a/bin/backup.sh +++ b/bin/backup.sh @@ -20,14 +20,15 @@ time="`which time`" # Ensure backup directory exists with correct permissions. mkdir -pv "$BACKUP_DIR" -chmod -Rv 755 "$BACKUP_DIR" +mkdir -pv "$BACKUP_DIR/TRASH" +chmod -Rv 775 "$BACKUP_DIR" chown -Rv root:root "$BACKUP_DIR" -cd "$BACKUP_DIR" # Remove the last backup. echo "`date` - Removing existing files." -mv -v "$BASENAME"*"$TAG"* ~/TRASH/ -rm -v ~/TRASH/"${BASENAME}*${TAG}*.zip" +cd "$BACKUP_DIR" +mv -v "$BASENAME"*"$TAG"* TRASH/ +rm -v TRASH/* echo -e "\n`date` - Take down services for a cold backup." manage.sh -d -- 2.49.1 From 04089744e65da0f31637ed89702f9cf7b4d1558c Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 14 Oct 2025 12:22:41 -0700 Subject: [PATCH 23/33] Change label for starting cronjob. --- Config/Hyperling.com/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Config/Hyperling.com/Dockerfile b/Config/Hyperling.com/Dockerfile index 5e25ec9..8a71a4d 100644 --- a/Config/Hyperling.com/Dockerfile +++ b/Config/Hyperling.com/Dockerfile @@ -6,7 +6,7 @@ FROM node:lts-slim # Cache System Dependencies -RUN apt-get update && apt-get install -y git php-cli sudo curl +RUN apt-get update && apt-get install -y git php-cli sudo curl procps # Cache Node Dependencies RUN mkdir -p /var/www/api -- 2.49.1 From 394acfa06d14d4f999a0b20e61b00d9f61d64592 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 14 Oct 2025 14:08:13 -0700 Subject: [PATCH 24/33] Critical changes for upcoming Hyperling.com 2.0! Automatic page updates after a pull request within 30 seconds, no reload necessary! --- Config/Hyperling.com/Dockerfile | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Config/Hyperling.com/Dockerfile b/Config/Hyperling.com/Dockerfile index 8a71a4d..18c8e99 100644 --- a/Config/Hyperling.com/Dockerfile +++ b/Config/Hyperling.com/Dockerfile @@ -16,10 +16,13 @@ RUN npm install # Install + Run Website CMD cd /var/www/api && \ - rm -rfv pages main.js run.sh && \ - git clone https://git.hyperling.com/me/nodejs-website website && \ - rm -rfv website/files && \ - mv -v website/* ./ && \ + echo "Ensure symlink is properly deleted if it exists..." && \ + ls -l website/files; rm -v website/files; sleep 0 && \ rm -rfv website && \ - echo "Starting Website's Run Script" && \ + git clone https://git.hyperling.com/me/nodejs-website --branch=dev website && \ + rm -rfv website/files && \ + cd website && \ + ln -sv ../files ./files && \ + find ./files -exec git update-index --assume-unchanged {} \; && \ + echo "Starting Website" && \ ./run.sh -- 2.49.1 From a49d0129e733898b59688fb8e2169d5cba9c3fab Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 14 Oct 2025 14:10:00 -0700 Subject: [PATCH 25/33] Enhance output when starting Hyperling.com. --- Config/Hyperling.com/Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Config/Hyperling.com/Dockerfile b/Config/Hyperling.com/Dockerfile index 18c8e99..5fa0d10 100644 --- a/Config/Hyperling.com/Dockerfile +++ b/Config/Hyperling.com/Dockerfile @@ -18,11 +18,14 @@ RUN npm install CMD cd /var/www/api && \ echo "Ensure symlink is properly deleted if it exists..." && \ ls -l website/files; rm -v website/files; sleep 0 && \ + echo "Clone the website's Git repo..." && \ rm -rfv website && \ git clone https://git.hyperling.com/me/nodejs-website --branch=dev website && \ + echo "Remove dummy files and replace with symlink..." && \ rm -rfv website/files && \ cd website && \ ln -sv ../files ./files && \ + echo "Allow files under files/ to be ignored by Git..." && \ find ./files -exec git update-index --assume-unchanged {} \; && \ - echo "Starting Website" && \ + echo "Start website!" && \ ./run.sh -- 2.49.1 From 6973640b4e43331f005f1faa718f3a4d4b1ded98 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 14 Oct 2025 14:12:02 -0700 Subject: [PATCH 26/33] Explicitly mention where the output is coming from. --- Config/Hyperling.com/Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Config/Hyperling.com/Dockerfile b/Config/Hyperling.com/Dockerfile index 5fa0d10..94f99cf 100644 --- a/Config/Hyperling.com/Dockerfile +++ b/Config/Hyperling.com/Dockerfile @@ -16,16 +16,16 @@ RUN npm install # Install + Run Website CMD cd /var/www/api && \ - echo "Ensure symlink is properly deleted if it exists..." && \ + echo "Dockerfile: Ensure symlink is properly deleted if it exists..." && \ ls -l website/files; rm -v website/files; sleep 0 && \ - echo "Clone the website's Git repo..." && \ + echo "Dockerfile: Clone the website's Git repo..." && \ rm -rfv website && \ git clone https://git.hyperling.com/me/nodejs-website --branch=dev website && \ - echo "Remove dummy files and replace with symlink..." && \ + echo "Dockerfile: Remove dummy files and replace with symlink..." && \ rm -rfv website/files && \ cd website && \ ln -sv ../files ./files && \ - echo "Allow files under files/ to be ignored by Git..." && \ + echo "Dockerfile: Allow files under files/ to be ignored by Git..." && \ find ./files -exec git update-index --assume-unchanged {} \; && \ - echo "Start website!" && \ + echo "Dockerfile: Start website!" && \ ./run.sh -- 2.49.1 From 95060838e29ee466ad0c96490d4f1c56d4fe38cd Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 14 Oct 2025 14:14:04 -0700 Subject: [PATCH 27/33] Remove using the dev branch on Production! Should only be on the Stage version of the Dockerfile. --- Config/Hyperling.com/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Config/Hyperling.com/Dockerfile b/Config/Hyperling.com/Dockerfile index 94f99cf..c033639 100644 --- a/Config/Hyperling.com/Dockerfile +++ b/Config/Hyperling.com/Dockerfile @@ -20,7 +20,7 @@ CMD cd /var/www/api && \ ls -l website/files; rm -v website/files; sleep 0 && \ echo "Dockerfile: Clone the website's Git repo..." && \ rm -rfv website && \ - git clone https://git.hyperling.com/me/nodejs-website --branch=dev website && \ + git clone https://git.hyperling.com/me/nodejs-website website && \ echo "Dockerfile: Remove dummy files and replace with symlink..." && \ rm -rfv website/files && \ cd website && \ -- 2.49.1 From 418983c490db88a5b0748a545913101f532f7a43 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 14 Oct 2025 14:21:59 -0700 Subject: [PATCH 28/33] Add env variable for which branch to use. Move CPU and RAM requirements to env so that only 1 `docker-compose.yml` example is needed. --- Config/Hyperling.com/Dockerfile | 2 +- ...e.standard.yml => docker-compose.main.yml} | 8 +++++-- Config/Hyperling.com/docker-compose.micro.yml | 21 ------------------- Config/Hyperling.com/env.example | 15 +++++++++++++ 4 files changed, 22 insertions(+), 24 deletions(-) rename Config/Hyperling.com/{docker-compose.standard.yml => docker-compose.main.yml} (71%) delete mode 100644 Config/Hyperling.com/docker-compose.micro.yml diff --git a/Config/Hyperling.com/Dockerfile b/Config/Hyperling.com/Dockerfile index c033639..90d2181 100644 --- a/Config/Hyperling.com/Dockerfile +++ b/Config/Hyperling.com/Dockerfile @@ -20,7 +20,7 @@ CMD cd /var/www/api && \ ls -l website/files; rm -v website/files; sleep 0 && \ echo "Dockerfile: Clone the website's Git repo..." && \ rm -rfv website && \ - git clone https://git.hyperling.com/me/nodejs-website website && \ + git clone https://git.hyperling.com/me/nodejs-website $BRANCH website && \ echo "Dockerfile: Remove dummy files and replace with symlink..." && \ rm -rfv website/files && \ cd website && \ diff --git a/Config/Hyperling.com/docker-compose.standard.yml b/Config/Hyperling.com/docker-compose.main.yml similarity index 71% rename from Config/Hyperling.com/docker-compose.standard.yml rename to Config/Hyperling.com/docker-compose.main.yml index 917e319..6543013 100644 --- a/Config/Hyperling.com/docker-compose.standard.yml +++ b/Config/Hyperling.com/docker-compose.main.yml @@ -10,11 +10,15 @@ services: restart: always ports: - 8317:8080 + environment: + - BRANCH=$BRANCH + - CPU=$CPU + - MEM=$MEM volumes: - ./files:/var/www/api/files deploy: mode: global resources: limits: - cpus: '0.25' - memory: 256M + cpus: $CPU + memory: $RAM diff --git a/Config/Hyperling.com/docker-compose.micro.yml b/Config/Hyperling.com/docker-compose.micro.yml deleted file mode 100644 index a3961c1..0000000 --- a/Config/Hyperling.com/docker-compose.micro.yml +++ /dev/null @@ -1,21 +0,0 @@ -# 2022-10-29 -# Hyperling.com configuration. -# 2023-01-24 container needs 128M to get started fully then settles to 25M. - -services: - app: - container_name: www-app - build: - context: ./ - network: host - restart: always - ports: - - 8317:8080 - volumes: - - ./files:/var/www/api/files - deploy: - mode: global - resources: - limits: - cpus: '0.10' - memory: 128M diff --git a/Config/Hyperling.com/env.example b/Config/Hyperling.com/env.example index 768122e..d30e7ea 100644 --- a/Config/Hyperling.com/env.example +++ b/Config/Hyperling.com/env.example @@ -7,3 +7,18 @@ # Subsequent builds consistently take less than 2 seconds. # Testing was done on the micro server, not a workstation. COMPOSE_BAKE=true + +## Branch ## +# Allow choosing the branch. By keaving it blank, main will be used. +# Should be in the full "--branch my-branch" syntax. +BRANCH= +#BRANCH="--branch dev" + +## Performance ## +# Standard Server +CPU=0.25 +MEM=0.25G +# Micro Server +# 2023-01-24 container needs 128M to get started fully then settles to 25M. +CPU=0.10 +MEM=128M -- 2.49.1 From c04eb08f781f1d43aa7c6c65c5f29d0e469fda70 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 14 Oct 2025 14:22:27 -0700 Subject: [PATCH 29/33] Comment the micro server requirements. --- Config/Hyperling.com/env.example | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Config/Hyperling.com/env.example b/Config/Hyperling.com/env.example index d30e7ea..3f0bcdf 100644 --- a/Config/Hyperling.com/env.example +++ b/Config/Hyperling.com/env.example @@ -20,5 +20,5 @@ CPU=0.25 MEM=0.25G # Micro Server # 2023-01-24 container needs 128M to get started fully then settles to 25M. -CPU=0.10 -MEM=128M +#CPU=0.10 +#MEM=128M -- 2.49.1 From dd60d5a72104d3ddfe91647e33fe925dbedf9492 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 14 Oct 2025 14:23:18 -0700 Subject: [PATCH 30/33] Fix typos and wording in comments. --- Config/Hyperling.com/env.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Config/Hyperling.com/env.example b/Config/Hyperling.com/env.example index 3f0bcdf..e67a4d9 100644 --- a/Config/Hyperling.com/env.example +++ b/Config/Hyperling.com/env.example @@ -9,7 +9,7 @@ COMPOSE_BAKE=true ## Branch ## -# Allow choosing the branch. By keaving it blank, main will be used. +# Allow choosing the branch. By leaving it blank, the main branch will be used. # Should be in the full "--branch my-branch" syntax. BRANCH= #BRANCH="--branch dev" -- 2.49.1 From d2aa3c195bf8e8a1701fcbdaf2fc76408fb7c613 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 14 Oct 2025 14:23:40 -0700 Subject: [PATCH 31/33] Fix typo in variable name. --- Config/Hyperling.com/docker-compose.main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Config/Hyperling.com/docker-compose.main.yml b/Config/Hyperling.com/docker-compose.main.yml index 6543013..8bd8494 100644 --- a/Config/Hyperling.com/docker-compose.main.yml +++ b/Config/Hyperling.com/docker-compose.main.yml @@ -21,4 +21,4 @@ services: resources: limits: cpus: $CPU - memory: $RAM + memory: $MEM -- 2.49.1 From b9d977152331a3c542209bef9cad497300bd98cc Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 14 Oct 2025 14:30:40 -0700 Subject: [PATCH 32/33] Add echo of $BRANCH contents. --- Config/Hyperling.com/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Config/Hyperling.com/Dockerfile b/Config/Hyperling.com/Dockerfile index 90d2181..b6c6191 100644 --- a/Config/Hyperling.com/Dockerfile +++ b/Config/Hyperling.com/Dockerfile @@ -18,7 +18,7 @@ RUN npm install CMD cd /var/www/api && \ echo "Dockerfile: Ensure symlink is properly deleted if it exists..." && \ ls -l website/files; rm -v website/files; sleep 0 && \ - echo "Dockerfile: Clone the website's Git repo..." && \ + echo "Dockerfile: Clone the website's Git repo... BRANCH='$BRANCH'" && \ rm -rfv website && \ git clone https://git.hyperling.com/me/nodejs-website $BRANCH website && \ echo "Dockerfile: Remove dummy files and replace with symlink..." && \ -- 2.49.1 From 9314bb8bb469cdf8d22715471428f69a38808b6d Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 14 Oct 2025 14:32:26 -0700 Subject: [PATCH 33/33] Have the git command give us the branch instead. --- Config/Hyperling.com/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Config/Hyperling.com/Dockerfile b/Config/Hyperling.com/Dockerfile index b6c6191..183b365 100644 --- a/Config/Hyperling.com/Dockerfile +++ b/Config/Hyperling.com/Dockerfile @@ -18,12 +18,14 @@ RUN npm install CMD cd /var/www/api && \ echo "Dockerfile: Ensure symlink is properly deleted if it exists..." && \ ls -l website/files; rm -v website/files; sleep 0 && \ - echo "Dockerfile: Clone the website's Git repo... BRANCH='$BRANCH'" && \ + echo "Dockerfile: Clone the website's Git repo..." && \ rm -rfv website && \ git clone https://git.hyperling.com/me/nodejs-website $BRANCH website && \ echo "Dockerfile: Remove dummy files and replace with symlink..." && \ rm -rfv website/files && \ cd website && \ + echo -n "Dockerfile: Using branch " && \ + git branch && \ ln -sv ../files ./files && \ echo "Dockerfile: Allow files under files/ to be ignored by Git..." && \ find ./files -exec git update-index --assume-unchanged {} \; && \ -- 2.49.1