Compare commits
73 Commits
main
...
921c450f03
| Author | SHA1 | Date | |
|---|---|---|---|
| 921c450f03 | |||
| 933d307254 | |||
| 6a2dcba0f9 | |||
| 2d565c94f0 | |||
| b490c84b37 | |||
| fa25327462 | |||
| 9ab6335a3c | |||
| 0eb2ecf033 | |||
| a233f32751 | |||
| 99afb5ac50 | |||
| f16b44a5b6 | |||
| 87a571c89a | |||
| 52d108fa75 | |||
| df3a4cb354 | |||
| 44f4aa55c6 | |||
| 7199a88627 | |||
| bf2499e6ce | |||
| e8e4b69ed6 | |||
| 9bc7988b81 | |||
| 0ed000cd20 | |||
| 4264e47577 | |||
| 1bcf5f3e7b | |||
| 221a446996 | |||
| 2e4520d6ae | |||
| 7dd2ef5e75 | |||
| ffabb62f94 | |||
| b76898d146 | |||
| 57b2a1c986 | |||
| c2bb70ee23 | |||
| 5f1db78b25 | |||
| 89d166f0cc | |||
| 05374bf501 | |||
| 945039bd8a | |||
| 46e786b219 | |||
| f2604ff1fd | |||
| f12f945a04 | |||
| 12bf792e65 | |||
| c607fe1968 | |||
| 50a975b8ec | |||
| 40268e40b0 | |||
| d92a1f1205 | |||
| b4b366a857 | |||
| 87048191ce | |||
| 564dec0b63 | |||
| 427471d825 | |||
| 165c2aa64c | |||
| 4772826d4a | |||
| 052b28e265 | |||
| 4cc229a66d | |||
| 978a9778a5 | |||
| e5c68aa12e | |||
| b16bf3cf07 | |||
| 50b7629860 | |||
| 91dfbca76e | |||
| c0a220cebe | |||
| 369728b7ef | |||
| 31dda9d64f | |||
| 0e87eb3515 | |||
| bf0497c02a | |||
| 9079afd570 | |||
| 93e0971050 | |||
| c19b73e3f0 | |||
| 018c3c9ceb | |||
| 7e733dedcb | |||
| dac5c0de17 | |||
| 3ae7a6f8f9 | |||
| 567f1de450 | |||
| 3ca8b036ad | |||
| 3897d6f3c3 | |||
| fdff4f0d27 | |||
| 7b9bbcbc26 | |||
| cbaf052ea2 | |||
| c4c3cb6434 |
24
.gitignore
vendored
24
.gitignore
vendored
@@ -25,9 +25,11 @@ Config/DNS/config/*
|
||||
|
||||
# Ignore anything in disabled folders.
|
||||
disabled
|
||||
*.disabled
|
||||
disabled.*
|
||||
|
||||
# Ignore any .env files which are not explicitly committed to the project.
|
||||
*.env
|
||||
.env
|
||||
|
||||
# 2024-01-23 Ignore true docker-compose files, only show examples from now on.
|
||||
docker-compose.yml
|
||||
@@ -35,10 +37,28 @@ docker-compose.yml
|
||||
# 2024-01-24 Hide static files for Hyperling.com.
|
||||
Config/Hyperling.com/files/*
|
||||
|
||||
# Ignore things like "Config/Hyperling.com-Stage/""
|
||||
# Ignore things like "Config/Hyperling.com-Stage/"
|
||||
*-Stage
|
||||
*-stage
|
||||
*-STAGE
|
||||
Stage-*
|
||||
stage-*
|
||||
STAGE-*
|
||||
|
||||
# Ignore copies of the Hugo configuration, such as "Config/Hugo-MyWebsite".
|
||||
Hugo-*
|
||||
*-Hugo
|
||||
|
||||
# Ignore Prod and Dev copies as well.
|
||||
*-Prod
|
||||
*-prod
|
||||
*-PROD
|
||||
Prod-*
|
||||
prod-*
|
||||
PROD-*
|
||||
*-Dev
|
||||
*-dev
|
||||
*-DEV
|
||||
Dev-*
|
||||
dev-*
|
||||
DEV-*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Local DNS
|
||||
Host a local DNS server in case your router/gateway is not cutting it. Allows
|
||||
the ability to use simple names across the network witrhout editing `/etc/hosts`
|
||||
on each machine. The IP of this server should be added to the router/gateway's
|
||||
on each machine. The IP of this server will be added to the router/gateway's
|
||||
settings so that all machines on the network know to use it and can benefit.
|
||||
|
||||
@@ -19,8 +19,5 @@ services:
|
||||
mode: global
|
||||
resources:
|
||||
limits:
|
||||
cpus: '0.50'
|
||||
memory: 512M
|
||||
reservations:
|
||||
cpus: '0.25'
|
||||
memory: 128M
|
||||
cpus: $CPU
|
||||
memory: $MEM
|
||||
12
Config/DNS/example.env
Normal file
12
Config/DNS/example.env
Normal file
@@ -0,0 +1,12 @@
|
||||
# This file will need copied as `.env`.
|
||||
|
||||
## Docker ##
|
||||
|
||||
CMPOSE_BAKE=true
|
||||
|
||||
## Performance ##
|
||||
|
||||
# Standard Server
|
||||
|
||||
CPU=0.50
|
||||
MEM=0.50G
|
||||
@@ -46,8 +46,8 @@ fi
|
||||
echo "nameserver 1.1.1.1" > /etc/resolv.conf
|
||||
|
||||
echo -e "\n*** Start the docker container ***"
|
||||
docker compose down
|
||||
docker compose build
|
||||
docker compose down
|
||||
docker compose up -d
|
||||
|
||||
echo -e "\n*** Now use the local process for DNS ***\n/etc/resolv.conf:"
|
||||
|
||||
@@ -42,7 +42,7 @@ function usage {
|
||||
}
|
||||
|
||||
function check {
|
||||
# Accepts parameter of status and whether the program should quit.
|
||||
# Accepts parameter of status and whether the program is needs to quit.
|
||||
status=$1
|
||||
quit=$2
|
||||
if [[ $status != 0 ]]; then
|
||||
|
||||
118
Config/F-DroidRepo/Dockerfile
Normal file
118
Config/F-DroidRepo/Dockerfile
Normal file
@@ -0,0 +1,118 @@
|
||||
# Build a container which hosts Android apps through an F-Droid repository.
|
||||
|
||||
# Base Image #
|
||||
|
||||
FROM debian:trixie-slim
|
||||
|
||||
# variables #
|
||||
|
||||
ENV WEBROOT="/var/www/html"
|
||||
ENV FDROID="/root/fdroid"
|
||||
ENV REPO="$FDROID/repo"
|
||||
|
||||
# Install Packages#
|
||||
# https://f-droid.org/en/docs/Installing_the_Server_and_Repo_Tools/#debianubuntumintetc
|
||||
|
||||
RUN apt-get update && apt-get install -y sudo bash curl git vim nginx
|
||||
COPY files/debian-backports.sources /etc/apt/sources.list.d/
|
||||
RUN apt-get update && apt-get install -y -t trixie-backports fdroidserver
|
||||
|
||||
# Generate F-Droid Repo #
|
||||
|
||||
USER root
|
||||
RUN mkdir -pv "$FDROID"
|
||||
WORKDIR "$FDROID"
|
||||
RUN fdroid init
|
||||
|
||||
# Start Command #
|
||||
|
||||
CMD nginx -g "daemon off;"
|
||||
|
||||
# This is where the image would get published. #
|
||||
|
||||
# Configure F-Droid Repo #
|
||||
|
||||
ARG REPO_DOMAIN
|
||||
ENV REPO_DOMAIN="$REPO_DOMAIN"
|
||||
ARG REPO_NAME
|
||||
ENV REPO_NAME="$REPO_NAME"
|
||||
|
||||
# TBD/TODO: Add commands to remove repo_url and repo_name if they already exist.
|
||||
|
||||
RUN sed -i "$ a repo_url: $REPO_DOMAIN/fdroid/repo" "$FDROID/config.yml"
|
||||
RUN sed -i "$ a repo_name: $REPO_NAME" "$FDROID/config.yml"
|
||||
|
||||
RUN fdroid update
|
||||
|
||||
# Advanced Variables #
|
||||
|
||||
ARG FILE00
|
||||
ENV FILE00="$FILE00"
|
||||
ARG FILE01
|
||||
ENV FILE01="$FILE01"
|
||||
ARG FILE02
|
||||
ENV FILE02="$FILE02"
|
||||
ARG FILE03
|
||||
ENV FILE03="$FILE03"
|
||||
ARG FILE04
|
||||
ENV FILE04="$FILE04"
|
||||
ARG FILE05
|
||||
ENV FILE05="$FILE05"
|
||||
ARG FILE06
|
||||
ENV FILE06="$FILE06"
|
||||
ARG FILE07
|
||||
ENV FILE07="$FILE07"
|
||||
ARG FILE08
|
||||
ENV FILE08="$FILE08"
|
||||
ARG FILE09
|
||||
ENV FILE09="$FILE09"
|
||||
ARG FILE10
|
||||
ENV FILE10="$FILE10"
|
||||
ARG FILE11
|
||||
ENV FILE11="$FILE11"
|
||||
ARG FILE12
|
||||
ENV FILE12="$FILE12"
|
||||
ARG FILE13
|
||||
ENV FILE13="$FILE13"
|
||||
ARG FILE14
|
||||
ENV FILE14="$FILE14"
|
||||
ARG FILE15
|
||||
ENV FILE15="$FILE15"
|
||||
ARG FILE16
|
||||
ENV FILE16="$FILE16"
|
||||
ARG FILE17
|
||||
ENV FILE17="$FILE17"
|
||||
ARG FILE18
|
||||
ENV FILE18="$FILE18"
|
||||
ARG FILE19
|
||||
ENV FILE19="$FILE19"
|
||||
|
||||
# Download Remote Files #
|
||||
|
||||
RUN mkdir -pv /root/fdroid/repo
|
||||
RUN bash -c 'if [[ -n "$FILE00" ]]; then wget -P "$REPO" "$FILE00"; fi'
|
||||
RUN bash -c 'if [[ -n "$FILE01" ]]; then wget -P "$REPO" "$FILE01"; fi'
|
||||
RUN bash -c 'if [[ -n "$FILE02" ]]; then wget -P "$REPO" "$FILE02"; fi'
|
||||
RUN bash -c 'if [[ -n "$FILE03" ]]; then wget -P "$REPO" "$FILE03"; fi'
|
||||
RUN bash -c 'if [[ -n "$FILE04" ]]; then wget -P "$REPO" "$FILE04"; fi'
|
||||
RUN bash -c 'if [[ -n "$FILE05" ]]; then wget -P "$REPO" "$FILE05"; fi'
|
||||
RUN bash -c 'if [[ -n "$FILE06" ]]; then wget -P "$REPO" "$FILE06"; fi'
|
||||
RUN bash -c 'if [[ -n "$FILE07" ]]; then wget -P "$REPO" "$FILE07"; fi'
|
||||
RUN bash -c 'if [[ -n "$FILE08" ]]; then wget -P "$REPO" "$FILE08"; fi'
|
||||
RUN bash -c 'if [[ -n "$FILE09" ]]; then wget -P "$REPO" "$FILE09"; fi'
|
||||
RUN bash -c 'if [[ -n "$FILE10" ]]; then wget -P "$REPO" "$FILE10"; fi'
|
||||
RUN bash -c 'if [[ -n "$FILE11" ]]; then wget -P "$REPO" "$FILE11"; fi'
|
||||
RUN bash -c 'if [[ -n "$FILE12" ]]; then wget -P "$REPO" "$FILE12"; fi'
|
||||
RUN bash -c 'if [[ -n "$FILE13" ]]; then wget -P "$REPO" "$FILE13"; fi'
|
||||
RUN bash -c 'if [[ -n "$FILE14" ]]; then wget -P "$REPO" "$FILE14"; fi'
|
||||
RUN bash -c 'if [[ -n "$FILE15" ]]; then wget -P "$REPO" "$FILE15"; fi'
|
||||
RUN bash -c 'if [[ -n "$FILE16" ]]; then wget -P "$REPO" "$FILE16"; fi'
|
||||
RUN bash -c 'if [[ -n "$FILE17" ]]; then wget -P "$REPO" "$FILE17"; fi'
|
||||
RUN bash -c 'if [[ -n "$FILE18" ]]; then wget -P "$REPO" "$FILE18"; fi'
|
||||
RUN bash -c 'if [[ -n "$FILE19" ]]; then wget -P "$REPO" "$FILE19"; fi'
|
||||
|
||||
RUN fdroid update -c
|
||||
|
||||
# Publish Repo Contents to Web Root #
|
||||
|
||||
RUN cp -r "$REPO/"* "$WEBROOT/"
|
||||
23
Config/F-DroidRepo/README.md
Normal file
23
Config/F-DroidRepo/README.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# F-Droid Repo
|
||||
|
||||
Simple container to create a 3rd party repository to be imported into F-Droid.
|
||||
|
||||
Downloads all the APKs during the build process and loads them automatically,
|
||||
does not need any interaction other than modifying the `.env` with the URLs
|
||||
of the apps you would like to be present.
|
||||
|
||||
If any apps get updated, rebuilding the container should pull any changes.
|
||||
|
||||
``` shell
|
||||
docker compose build
|
||||
docker compose down
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
## Guide followed to create this Container
|
||||
|
||||
https://f-droid.org/en/docs/Setup_an_F-Droid_App_Repo/
|
||||
|
||||
## App Metadata
|
||||
|
||||
TBD
|
||||
70
Config/F-DroidRepo/docker-compose.example.yml
Normal file
70
Config/F-DroidRepo/docker-compose.example.yml
Normal file
@@ -0,0 +1,70 @@
|
||||
# 2025-11-01 Hyperling
|
||||
# Create a 3rd party F-Droid repository for providing app updates.
|
||||
|
||||
services:
|
||||
app:
|
||||
container_name: fd-app
|
||||
build:
|
||||
context: ./
|
||||
network: host
|
||||
args:
|
||||
#WEBROOT: ${WEBROOT}
|
||||
#REPO: ${REPO}
|
||||
REPO_DOMAIN: ${REPO_DOMAIN}
|
||||
REPO_NAME: ${REPO_NAME}
|
||||
FILE00: ${FILE00}
|
||||
FILE01: ${FILE01}
|
||||
FILE02: ${FILE02}
|
||||
FILE03: ${FILE03}
|
||||
FILE04: ${FILE04}
|
||||
FILE05: ${FILE05}
|
||||
FILE06: ${FILE06}
|
||||
FILE07: ${FILE07}
|
||||
FILE08: ${FILE08}
|
||||
FILE09: ${FILE09}
|
||||
FILE10: ${FILE10}
|
||||
FILE11: ${FILE11}
|
||||
FILE12: ${FILE12}
|
||||
FILE13: ${FILE13}
|
||||
FILE14: ${FILE14}
|
||||
FILE15: ${FILE15}
|
||||
FILE16: ${FILE16}
|
||||
FILE17: ${FILE17}
|
||||
FILE18: ${FILE18}
|
||||
FILE19: ${FILE19}
|
||||
restart: always
|
||||
ports:
|
||||
- "8015:80"
|
||||
environment:
|
||||
#- WEBROOT=$WEBROOT
|
||||
#- REPO=$REPO
|
||||
- REPO_DOMAIN=$REPO_DOMAIN
|
||||
- REPO_NAME=$REPO_NAME
|
||||
- FILE00=$FILE00
|
||||
- FILE01=$FILE01
|
||||
- FILE02=$FILE02
|
||||
- FILE03=$FILE03
|
||||
- FILE04=$FILE04
|
||||
- FILE05=$FILE05
|
||||
- FILE06=$FILE06
|
||||
- FILE07=$FILE07
|
||||
- FILE08=$FILE08
|
||||
- FILE09=$FILE09
|
||||
- FILE10=$FILE10
|
||||
- FILE11=$FILE11
|
||||
- FILE12=$FILE12
|
||||
- FILE13=$FILE13
|
||||
- FILE14=$FILE14
|
||||
- FILE15=$FILE15
|
||||
- FILE16=$FILE16
|
||||
- FILE17=$FILE17
|
||||
- FILE18=$FILE18
|
||||
- FILE19=$FILE19
|
||||
volumes:
|
||||
- ../../Volumes/F-DroidRepo/share:/root/share
|
||||
deploy:
|
||||
mode: global
|
||||
resources:
|
||||
limits:
|
||||
cpus: $CPU
|
||||
memory: $MEM
|
||||
44
Config/F-DroidRepo/example.env
Normal file
44
Config/F-DroidRepo/example.env
Normal file
@@ -0,0 +1,44 @@
|
||||
# This file will need copied as `.env` and to have its values changed.
|
||||
|
||||
## Docker ##
|
||||
|
||||
COMPOSE_BAKE=true
|
||||
|
||||
## Performance ##
|
||||
|
||||
CPU=0.25
|
||||
MEM=0.25G
|
||||
|
||||
## Repo Settings ##
|
||||
|
||||
#WEBROOT="/var/www/html"
|
||||
#REPO="/root/fdroid"
|
||||
|
||||
REPO_DOMAIN="https://fdroid.hyperling.com"
|
||||
REPO_NAME="Hyperling's Apps"
|
||||
|
||||
## Files ##
|
||||
# Should be provided as URLs directly to the APK files.
|
||||
# TBD: Eventually change APKs to not have version number in them.
|
||||
# - Currently being done because Obtainium does not read the Gitea release/tag.
|
||||
|
||||
FILE00="https://git.hyperling.com/me/android-carb-up/releases/download/latest/CarbUp_v1.0.1.apk"
|
||||
FILE01="https://git.hyperling.com/me/flutter-expense-tracker/releases/download/latest/ExpenseTracker_v0.1.3.apk"
|
||||
FILE02="https://git.hyperling.com/me/android-infinite-timer/releases/download/latest/InfiniteTimer_v1.1.1.apk"
|
||||
FILE03="https://git.hyperling.com/me/android-45-minute-rule/releases/download/latest/The45MinuteRule_v1.0.7.apk"
|
||||
FILE04="https://git.hyperling.com/me/android-tictactoe/releases/download/latest/TicTacToe_v1.1.0.apk"
|
||||
FILE05="https://git.hyperling.com/me/android-hypergames/releases/download/latest/HyperGames_v0.0.11.apk"
|
||||
FILE06=""
|
||||
FILE07=""
|
||||
FILE08=""
|
||||
FILE09=""
|
||||
FILE10="https://git.hyperling.com/me/ebook-freedom-flyer/releases/download/latest/VoluntarySovereignty.pdf"
|
||||
FILE11="https://git.hyperling.com/me/ebook-health-protocol/releases/download/latest/HyperlingsHealthProtocol.pdf"
|
||||
FILE12=""
|
||||
FILE13=""
|
||||
FILE14=""
|
||||
FILE15=""
|
||||
FILE16=""
|
||||
FILE17=""
|
||||
FILE18=""
|
||||
FILE19=""
|
||||
6
Config/F-DroidRepo/files/debian-backports.sources
Normal file
6
Config/F-DroidRepo/files/debian-backports.sources
Normal file
@@ -0,0 +1,6 @@
|
||||
Types: deb deb-src
|
||||
URIs: http://deb.debian.org/debian
|
||||
Suites: trixie-backports
|
||||
Components: main contrib non-free non-free-firmware
|
||||
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
|
||||
Enabled: yes
|
||||
34
Config/Gitea/docker-compose.example.yml
Normal file
34
Config/Gitea/docker-compose.example.yml
Normal file
@@ -0,0 +1,34 @@
|
||||
# 2024-12-30 Hyperling
|
||||
# Gitea self-hosted git server!
|
||||
# https://hub.docker.com/r/gitea/gitea
|
||||
# https://docs.gitea.com/installation/install-with-docker
|
||||
|
||||
# Takes nearly double the resources of Gogs.
|
||||
# Has a nicer UI and more features. Can anyone say, "Dark Theme"? ;D
|
||||
|
||||
services:
|
||||
|
||||
app:
|
||||
## Database ##
|
||||
# SQL Lite
|
||||
|
||||
## App ##
|
||||
container_name: gitea-app
|
||||
image: gitea/gitea:latest
|
||||
restart: always
|
||||
ports:
|
||||
- "3001:3000"
|
||||
- "2201:22"
|
||||
volumes:
|
||||
- ../../Volumes/Gitea/gitea:/data
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
environment:
|
||||
- USER_UID=1000
|
||||
- USER_GID=1000
|
||||
deploy:
|
||||
mode: global
|
||||
resources:
|
||||
limits:
|
||||
cpus: $CPU
|
||||
memory: $MEM
|
||||
@@ -1,71 +0,0 @@
|
||||
# 2024-12-30 Hyperling
|
||||
# Gitea self-hosted git server!
|
||||
# https://hub.docker.com/r/gitea/gitea
|
||||
# https://docs.gitea.com/installation/install-with-docker
|
||||
|
||||
# Takes nearly double the resources of Gogs.
|
||||
# Has a nicer UI and more features. Can anyone say, "Dark Theme"? ;D
|
||||
|
||||
services:
|
||||
|
||||
app:
|
||||
## Database ##
|
||||
# SQL Lite
|
||||
|
||||
## App ##
|
||||
container_name: gitea-app
|
||||
image: gitea/gitea:latest
|
||||
restart: always
|
||||
ports:
|
||||
- "3001:3000"
|
||||
- "2201:22"
|
||||
volumes:
|
||||
- ../../Volumes/Gitea/gitea:/data
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
environment:
|
||||
- USER_UID=1000
|
||||
- USER_GID=1000
|
||||
#networks:
|
||||
# - gitea
|
||||
deploy:
|
||||
mode: global
|
||||
resources:
|
||||
limits:
|
||||
# Minimum requirements for processes to start properly.
|
||||
# Takes a while to start up and migrate projects, but does work.
|
||||
###cpus: '0.05'
|
||||
###memory: 64M
|
||||
# Production-quality performance.
|
||||
###cpus: '0.10'
|
||||
###memory: 128M
|
||||
# Extra! Idles around 120M but exceeds 170M sometimes after busy.
|
||||
###cpus: '0.25'
|
||||
###memory: 192M
|
||||
# Final thoughts after tests.
|
||||
cpus: '0.50'
|
||||
memory: 192M
|
||||
|
||||
## Test Results ##
|
||||
# 0.05 CPU, 64MB RAM
|
||||
# - Migrate https://github.com/hyperling/ansible
|
||||
# - Page: 10512ms Template: 2111ms
|
||||
# - Migrate https://github.com/hyperling/website
|
||||
# - Page: 6514ms Template: 807ms
|
||||
# - Migrate https://github.com/hyperling/docker
|
||||
# - Page: 8105ms Template: 1201ms
|
||||
# 0.10 CPU, 128MB RAM
|
||||
# - Migrate https://github.com/hyperling/ansible
|
||||
# - Page: 2501ms Template: 294ms
|
||||
# - Migrate https://github.com/hyperling/website
|
||||
# - Page: 786ms Template: 194ms
|
||||
# - Migrate https://github.com/hyperling/docker
|
||||
# - Page: 1283ms Template: 87ms
|
||||
# 0.25 CPU, 192MB RAM
|
||||
# - Migrate https://github.com/hyperling/ansible
|
||||
# - Page: 439ms Template: 101ms
|
||||
# - Migrate https://github.com/hyperling/website
|
||||
# - Page: 541ms Template: 2ms
|
||||
# - Migrate https://github.com/hyperling/docker
|
||||
# - Page: 254ms Template: 86ms
|
||||
## ##
|
||||
45
Config/Gitea/example.env
Normal file
45
Config/Gitea/example.env
Normal file
@@ -0,0 +1,45 @@
|
||||
# This file wll need copied as `.env`.
|
||||
|
||||
## Docker ##
|
||||
|
||||
COMPOSE_BAKE=true
|
||||
|
||||
## Performance ##
|
||||
|
||||
# Micro Server
|
||||
CPU=0.20
|
||||
MEM=0.20G
|
||||
|
||||
# Standard Server
|
||||
#CPU=1.00
|
||||
#MEM=1.00G
|
||||
|
||||
## Test Results
|
||||
# 0.05 CPU, 64MB RAM
|
||||
# : Minimum requirements for processes to start properly.
|
||||
# : Takes a while to start up and migrate projects, but does work.
|
||||
# - Migrate https://github.com/hyperling/ansible
|
||||
# - Page: 10512ms Template: 2111ms
|
||||
# - Migrate https://github.com/hyperling/website
|
||||
# - Page: 6514ms Template: 807ms
|
||||
# - Migrate https://github.com/hyperling/docker
|
||||
# - Page: 8105ms Template: 1201ms
|
||||
# 0.10 CPU, 128MB RAM
|
||||
# : Production-quality performance.
|
||||
# - Migrate https://github.com/hyperling/ansible
|
||||
# - Page: 2501ms Template: 294ms
|
||||
# - Migrate https://github.com/hyperling/website
|
||||
# - Page: 786ms Template: 194ms
|
||||
# - Migrate https://github.com/hyperling/docker
|
||||
# - Page: 1283ms Template: 87ms
|
||||
# 0.25 CPU, 192MB RAM
|
||||
# : Extra! Idles around 120M but exceeds 170M sometimes after busy.
|
||||
# - Migrate https://github.com/hyperling/ansible
|
||||
# - Page: 439ms Template: 101ms
|
||||
# - Migrate https://github.com/hyperling/website
|
||||
# - Page: 541ms Template: 2ms
|
||||
# - Migrate https://github.com/hyperling/docker
|
||||
# - Page: 254ms Template: 86ms
|
||||
# 0.50 CPU, 192MB RAM
|
||||
# : Final thoughts after more production usage.
|
||||
##
|
||||
33
Config/Gogs/docker-compose.example.yml
Normal file
33
Config/Gogs/docker-compose.example.yml
Normal file
@@ -0,0 +1,33 @@
|
||||
# 2024-12-30 Hyperling
|
||||
# Gogs self-hosted git server!
|
||||
# https://hub.docker.com/r/gogs/gogs
|
||||
# https://gist.github.com/ahromis/4ce4a58623847ca82cb1b745c2f83c82
|
||||
|
||||
# Takes nearly half the resources of Gitea.
|
||||
# Has a more basic UI and may be lacking features. So slim though!!
|
||||
|
||||
services:
|
||||
|
||||
app:
|
||||
## Database ##
|
||||
# SQL Lite
|
||||
|
||||
## App ##
|
||||
container_name: gogs-app
|
||||
image: gogs/gogs:latest
|
||||
restart: always
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- "2202:22"
|
||||
volumes:
|
||||
- ../../Volumes/Gogs/gogs:/data
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
environment:
|
||||
- "RUN_CROND=true"
|
||||
deploy:
|
||||
mode: global
|
||||
resources:
|
||||
limits:
|
||||
cpus: $CPU
|
||||
memory: $MEM
|
||||
@@ -1,70 +0,0 @@
|
||||
# 2024-12-30 Hyperling
|
||||
# Gogs self-hosted git server!
|
||||
# https://hub.docker.com/r/gogs/gogs
|
||||
# https://gist.github.com/ahromis/4ce4a58623847ca82cb1b745c2f83c82
|
||||
|
||||
# Takes nearly half the resources of Gitea.
|
||||
# Has a more basic UI and may be lacking features. So slim though!!
|
||||
|
||||
services:
|
||||
|
||||
app:
|
||||
## Database ##
|
||||
# SQL Lite
|
||||
|
||||
## App ##
|
||||
container_name: gogs-app
|
||||
image: gogs/gogs:latest
|
||||
restart: always
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- "2202:22"
|
||||
volumes:
|
||||
- ../../Volumes/Gogs/gogs:/data
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
environment:
|
||||
- "RUN_CROND=true"
|
||||
#networks:
|
||||
# - gogs
|
||||
deploy:
|
||||
mode: global
|
||||
resources:
|
||||
limits:
|
||||
# Minimum requirements for processes to start properly.
|
||||
# Works pretty well! Takes a little to migrate, otherwise snappy!
|
||||
###cpus: '0.02'
|
||||
###memory: 32M
|
||||
# Seamless performance.
|
||||
###cpus: '0.05'
|
||||
###memory: 64M
|
||||
# Extra! Idles at 50M, will probably never use all this for 1 user.
|
||||
###cpus: '0.25'
|
||||
###memory: 192M
|
||||
# Final thoughts after tests.
|
||||
cpus: '0.50'
|
||||
memory: 96M
|
||||
|
||||
## Test Results ##
|
||||
# 0.02 CPU, 32MB RAM
|
||||
# - Migrate https://github.com/hyperling/ansible
|
||||
# - Page: 20684ms Template: 3001ms, Page: 16503ms Template: 492ms
|
||||
# - Migrate https://github.com/hyperling/website
|
||||
# - Page: 12495ms Template: 800ms
|
||||
# - Migrate https://github.com/hyperling/docker
|
||||
# - Page: 9591ms Template: 591ms
|
||||
# 0.05 CPU, 64MB RAM
|
||||
# - Migrate https://github.com/hyperling/ansible
|
||||
# - Page: 4602ms Template: 2ms
|
||||
# - Migrate https://github.com/hyperling/website
|
||||
# - Page: 3269ms Template: 1ms
|
||||
# - Migrate https://github.com/hyperling/docker
|
||||
# - Page: 2481ms Template: 1ms
|
||||
# 0.25 CPU, 192MB RAM
|
||||
# - Migrate https://github.com/hyperling/ansible
|
||||
# - Page: 575ms Template: 2ms
|
||||
# - Migrate https://github.com/hyperling/website
|
||||
# - Page: 131ms Template: 4ms
|
||||
# - Migrate https://github.com/hyperling/docker
|
||||
# - Page: 350ms Template: 1ms
|
||||
## ##
|
||||
45
Config/Gogs/example.env
Normal file
45
Config/Gogs/example.env
Normal file
@@ -0,0 +1,45 @@
|
||||
# This file will need to be renamed as `.env`.
|
||||
|
||||
## Docker ##
|
||||
|
||||
COMPOSE_BAKE=true
|
||||
|
||||
## Performance ##
|
||||
|
||||
# Micro Server
|
||||
CPU=0.10
|
||||
MEM=0.10G
|
||||
|
||||
# Standard Server
|
||||
#CPU=0.50
|
||||
#MEM=0.50G
|
||||
|
||||
## Test Results
|
||||
# 0.02 CPU, 32MB RAM
|
||||
# : Minimum requirements for processes to start properly.
|
||||
# : Works pretty well! Takes a little to migrate, otherwise snappy!
|
||||
# - Migrate https://github.com/hyperling/ansible
|
||||
# - Page: 20684ms Template: 3001ms, Page: 16503ms Template: 492ms
|
||||
# - Migrate https://github.com/hyperling/website
|
||||
# - Page: 12495ms Template: 800ms
|
||||
# - Migrate https://github.com/hyperling/docker
|
||||
# - Page: 9591ms Template: 591ms
|
||||
# 0.05 CPU, 64MB RAM
|
||||
# : Seamless performance.
|
||||
# - Migrate https://github.com/hyperling/ansible
|
||||
# - Page: 4602ms Template: 2ms
|
||||
# - Migrate https://github.com/hyperling/website
|
||||
# - Page: 3269ms Template: 1ms
|
||||
# - Migrate https://github.com/hyperling/docker
|
||||
# - Page: 2481ms Template: 1ms
|
||||
# 0.25 CPU, 192MB RAM
|
||||
# : Extra! Idles at 50M, will probably never use all this for 1 user.
|
||||
# - Migrate https://github.com/hyperling/ansible
|
||||
# - Page: 575ms Template: 2ms
|
||||
# - Migrate https://github.com/hyperling/website
|
||||
# - Page: 131ms Template: 4ms
|
||||
# - Migrate https://github.com/hyperling/docker
|
||||
# - Page: 350ms Template: 1ms
|
||||
# 0.50 CPU, 96MB RAM
|
||||
# : Final thoughts after tests.
|
||||
##
|
||||
@@ -1,7 +1,7 @@
|
||||
# 2025-08-13 Hyperling
|
||||
|
||||
## Image ##
|
||||
FROM debian:bookworm-slim
|
||||
FROM debian:trixie-slim
|
||||
|
||||
## Setup ##
|
||||
# System Dependencies
|
||||
|
||||
@@ -26,5 +26,5 @@ services:
|
||||
mode: global
|
||||
resources:
|
||||
limits:
|
||||
cpus: '0.10'
|
||||
memory: 64M
|
||||
cpus: $CPU
|
||||
memory: $MEM
|
||||
|
||||
@@ -6,13 +6,13 @@
|
||||
COMPOSE_BAKE=true
|
||||
|
||||
#
|
||||
## Git Website Repository
|
||||
## Git Website Repository ##
|
||||
#
|
||||
REPO=https://git.hyperling.com/me/hugo-jackanope
|
||||
BRANCH=main
|
||||
BRANCH=prod
|
||||
|
||||
#
|
||||
## Web Environments
|
||||
## Web Environments ##
|
||||
# Please use values YES/TRUE and NO/FALSE.
|
||||
|
||||
# Whether to start NGINX
|
||||
@@ -20,3 +20,9 @@ PROD=YES
|
||||
|
||||
# Whether to start Hugo Server
|
||||
DEV=NO
|
||||
|
||||
#
|
||||
## Resources ##
|
||||
#
|
||||
CPU=0.10
|
||||
MEM=0.10G
|
||||
@@ -17,12 +17,17 @@ DEV="$4"
|
||||
typeset -u DEV
|
||||
echo "DEV='$DEV'"
|
||||
|
||||
SITE="/var/www/hugo/site"
|
||||
|
||||
echo "*** Creating Git Repo ***"
|
||||
sudo -u www-data git clone --recurse-submodules $BRANCH $REPO /var/www/hugo/site
|
||||
if [[ -d $SITE ]]; then
|
||||
rm -rfv $SITE
|
||||
fi
|
||||
sudo -u www-data git clone --recurse-submodules $BRANCH $REPO $SITE
|
||||
status="$?"
|
||||
|
||||
echo "*** Validating Git Repo ***"
|
||||
if [[ $status != 0 || ! -d /var/www/hugo/site/.git ]]; then
|
||||
if [[ $status != 0 || ! -d $SITE/.git ]]; then
|
||||
echo "ERROR: Hugo project may not have cloned correctly. status='$status'"
|
||||
echo "Aborting."
|
||||
exit 1
|
||||
@@ -62,7 +67,7 @@ if [[ "$DEV" == "Y"* || "$DEV" == "T"* ]]; then
|
||||
http_code="`curl -sS http://localhost:1380 -o /dev/null -w "%{http_code}"`"
|
||||
if [[ $http_code != 200 ]]; then
|
||||
echo "* Dev server not detected, starting..."
|
||||
cd /var/www/hugo/site
|
||||
cd $SITE
|
||||
killall hugo 2>/dev/null
|
||||
sudo -u www-data hugo server -D --noBuildLock --bind 0.0.0.0 -p 1380 &
|
||||
fi
|
||||
|
||||
@@ -12,8 +12,6 @@ services:
|
||||
- 8317:8080
|
||||
environment:
|
||||
- BRANCH=$BRANCH
|
||||
- CPU=$CPU
|
||||
- MEM=$MEM
|
||||
volumes:
|
||||
- ./files:/var/www/api/files
|
||||
deploy:
|
||||
@@ -1,4 +1,4 @@
|
||||
# This file should be renamed '.env' and have any private values modified.
|
||||
# This file will need renamed '.env' and have any private values modified.
|
||||
|
||||
## 2025-06-16
|
||||
## Performance Notes for Enabling BAKE
|
||||
@@ -10,7 +10,7 @@ COMPOSE_BAKE=true
|
||||
|
||||
## Branch ##
|
||||
# Allow choosing the branch. By leaving it blank, the main branch will be used.
|
||||
# Should be in the full "--branch my-branch" syntax.
|
||||
# Needs to be in the full "--branch my-branch" syntax.
|
||||
BRANCH=
|
||||
#BRANCH="--branch dev"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Hyperling.com - files/
|
||||
|
||||
This is copied to the container's www/files/ folder for hosting static content.
|
||||
This is a volume for the container's /var/www/files/ which hosts static content.
|
||||
|
||||
TBD: Make this a volume, rather than copying with `Dockerfile`.
|
||||
TBD: Move this to Volumes?
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# This file should be renamed '.env' and have any private values modified.
|
||||
# This file will need renamed '.env' and have any private values modified.
|
||||
|
||||
COMPOSE_BAKE=true
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
# 2023-08-25 Hyperling
|
||||
# Put the cron command in a script as well as other automation.
|
||||
# This should be added to root's crontab with the full path, such as:
|
||||
# This will need added to root's crontab with the full path, such as:
|
||||
# */5 * * * * /opt/Docker/Config/Nextcloud/cron.ksh
|
||||
|
||||
DIR="$(dirname -- "${BASH_SOURCE[0]}")"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Example environment file for Nextcloud stack, should be copied as `.env`.
|
||||
# Example environment file for Nextcloud stack, needs copied as `.env`.
|
||||
|
||||
# The variables here only apply to the compose file. If you need it passed to a
|
||||
# container then it also needs specified in its `environment:` operator.
|
||||
@@ -32,7 +32,7 @@ PHP_UPLOAD_LIMIT=32M
|
||||
#
|
||||
## MariaDB ##
|
||||
#
|
||||
# Should load automatically the first run. Then config.php is the source of
|
||||
# Will load automatically the first run. Then config.php is the source of
|
||||
# truth for these values. So, if something like the DB password is changed,
|
||||
# updating it here will have no effect. This is only used for the install.
|
||||
|
||||
@@ -53,7 +53,7 @@ REDIS_HOST_PASSWORD=someredispassword
|
||||
###
|
||||
#### OnlyOffice ##
|
||||
###
|
||||
### How Nextcloud's ONLYOFFICE Admin Settings should be set up:
|
||||
### How Nextcloud's ONLYOFFICE Admin Settings needs set up:
|
||||
### OO Address: https://FQDN-For-Reverse-Proxied-OO-Server
|
||||
### OO Secret: Contents-Of-$JWT_SECRET
|
||||
### OO Header:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Example environment file for Nextcloud stack, should be copied as `.env`.
|
||||
# Example environment file for Nextcloud stack, needs copied as `.env`.
|
||||
|
||||
# The variables here only apply to the compose file. If you need it passed to a
|
||||
# container then it also needs specified in its `environment:` operator.
|
||||
@@ -32,7 +32,7 @@ PHP_UPLOAD_LIMIT=5G
|
||||
#
|
||||
## MariaDB ##
|
||||
#
|
||||
# Should load automatically the first run. Then config.php is the source of
|
||||
# Will load automatically the first run. Then config.php is the source of
|
||||
# truth for these values. So, if something like the DB password is changed,
|
||||
# updating it here will have no effect. This is only used for the install.
|
||||
|
||||
@@ -53,7 +53,7 @@ REDIS_HOST_PASSWORD=someredispassword
|
||||
#
|
||||
## OnlyOffice ##
|
||||
#
|
||||
# How Nextcloud's ONLYOFFICE Admin Settings should be set up:
|
||||
# How Nextcloud's ONLYOFFICE Admin Settings needs set up:
|
||||
# OO Address: https://FQDN-For-Reverse-Proxied-OO-Server
|
||||
# OO Secret: Contents-Of-$JWT_SECRET
|
||||
# OO Header:
|
||||
|
||||
@@ -121,8 +121,8 @@ services:
|
||||
mode: global
|
||||
resources:
|
||||
limits:
|
||||
cpus: '2.00'
|
||||
memory: 2G
|
||||
cpus: $CPU
|
||||
memory: $MEM
|
||||
|
||||
## Database Server (recommended)
|
||||
## see https://docs.photoprism.app/getting-started/faq/#should-i-use-sqlite-mariadb-or-mysql
|
||||
@@ -152,8 +152,8 @@ services:
|
||||
mode: global
|
||||
resources:
|
||||
limits:
|
||||
cpus: '0.50'
|
||||
memory: 512M
|
||||
cpus: $CPU_DB
|
||||
memory: $MEM_DB
|
||||
|
||||
# Configured but not using this, would prefer to update manually, and the
|
||||
# volume needs also seem sort of odd. Do not want it to harm other projects.
|
||||
@@ -1,3 +1,10 @@
|
||||
# This file will need to be copied as `.env`.
|
||||
|
||||
##
|
||||
# Docker
|
||||
##
|
||||
|
||||
COMPOSE_BAKE=true
|
||||
|
||||
##
|
||||
# PhotoPrism
|
||||
@@ -8,7 +15,7 @@ PHOTOPRISM_ADMIN_USER = "admin" # admin login username
|
||||
PHOTOPRISM_ADMIN_PASSWORD = "PleaseChangeMe" # initial admin password (8-72 characters)
|
||||
|
||||
# External FQDN
|
||||
# Should be in the format "http(s)://domain.name(:port)/(path)".
|
||||
# In the format "http(s)://domain.name(:port)/(path)".
|
||||
# Seems to work best if you leave off the s if behind a revese proxy,
|
||||
# such as: PHOTOPRISM_SITE_URL = "http://photoprism.example.com"
|
||||
PHOTOPRISM_SITE_URL = "http://localhost:2342"
|
||||
@@ -38,3 +45,12 @@ MARIADB_DATABASE = "photoprism"
|
||||
MARIADB_USER = "photoprism"
|
||||
MARIADB_PASSWORD = "PleaseChangeMe"
|
||||
MARIADB_ROOT_PASSWORD = "PleaseChangeMe"
|
||||
|
||||
##
|
||||
# Performance
|
||||
##
|
||||
|
||||
CPU=2.00
|
||||
MEM=2.00G
|
||||
CPU_DB=0.50
|
||||
MEM_DB=0.50G
|
||||
@@ -2,7 +2,16 @@
|
||||
|
||||
FROM archlinux:base
|
||||
|
||||
RUN pacman -Syu --noconfirm && pacman -Sy --noconfirm $PACKAGES $EXTRA_ARCH
|
||||
ARG PACKAGES
|
||||
ENV PACKAGES="$PACKAGES"
|
||||
ARG EXTRA_ARCH
|
||||
ENV EXTRA_ARCH="$EXTRA_ARCH"
|
||||
|
||||
# Arch is rolling, and therefore recommends updating the container immediately.
|
||||
# https://hub.docker.com/_/archlinux#updating
|
||||
RUN pacman -Syyu --noconfirm
|
||||
|
||||
RUN pacman -Syy --noconfirm $PACKAGES $EXTRA_ARCH
|
||||
|
||||
COPY bin/main.sh /root/main.sh
|
||||
RUN chmod +x /root/main.sh
|
||||
|
||||
@@ -1,8 +1,16 @@
|
||||
# Create a VM for testing Ansible provisioning.
|
||||
|
||||
FROM debian:trixie
|
||||
FROM debian:latest
|
||||
|
||||
RUN apt update && apt dist-upgrade -y && apt install -y $PACKAGES $EXTRA_DEBIAN
|
||||
ARG PACKAGES
|
||||
ENV PACKAGES="$PACKAGES"
|
||||
ARG EXTRA_DEBIAN
|
||||
ENV EXTRA_DEBIAN="$EXTRA_DEBIAN"
|
||||
|
||||
# Use the image as it comes, do not upgrade it, so that it stays reproducible.
|
||||
#RUN apt update && apt dist-upgrade -y
|
||||
|
||||
RUN apt update && apt install -y $PACKAGES $EXTRA_DEBIAN
|
||||
|
||||
COPY bin/main.sh /root/main.sh
|
||||
RUN chmod +x /root/main.sh
|
||||
|
||||
@@ -2,7 +2,15 @@
|
||||
|
||||
FROM fedora:latest
|
||||
|
||||
RUN dnf upgrade --refresh -y && dnf install -y $PACKAGES $EXTRA_FEDORA
|
||||
ARG PACKAGES
|
||||
ENV PACKAGES="$PACKAGES"
|
||||
ARG EXTRA_FEDORA
|
||||
ENV EXTRA_FEDORA="$EXTRA_FEDORA"
|
||||
|
||||
# Use the image as it comes, do not upgrade it, so that it stays reproducible.
|
||||
#RUN dnf upgrade --refresh -y
|
||||
|
||||
RUN dnf install --refresh -y $PACKAGES $EXTRA_FEDORA
|
||||
|
||||
COPY bin/main.sh /root/main.sh
|
||||
RUN chmod +x /root/main.sh
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
# Create a VM for testing Ansible provisioning.
|
||||
|
||||
FROM opensuse/tumbleweed
|
||||
FROM opensuse/tumbleweed:latest
|
||||
|
||||
RUN zypper -n refresh \
|
||||
&& zypper -n dist-upgrade -y \
|
||||
&& zypper -n install -y $PACKAGES $EXTRA_OPENSUSE
|
||||
ARG PACKAGES
|
||||
ENV PACKAGES="$PACKAGES"
|
||||
ARG EXTRA_OPENSUSE
|
||||
ENV EXTRA_OPENSUSE="$EXTRA_OPENSUSE"
|
||||
|
||||
# Use the image as it comes, do not upgrade it, so that it stays reproducible.
|
||||
#RUN zypper -n refresh && zypper -n dist-upgrade -y
|
||||
|
||||
RUN zypper -n refresh && zypper -n install -y $PACKAGES $EXTRA_OPENSUSE
|
||||
|
||||
COPY bin/main.sh /root/main.sh
|
||||
RUN chmod +x /root/main.sh
|
||||
|
||||
@@ -2,7 +2,15 @@
|
||||
|
||||
FROM ubuntu:rolling
|
||||
|
||||
RUN apt update && apt dist-upgrade -y && apt install -y $PACKAGES $EXTRA_UBUNTU
|
||||
ARG PACKAGES
|
||||
ENV PACKAGES="$PACKAGES"
|
||||
ARG EXTRA_UBUNTU
|
||||
ENV EXTRA_UBUNTU="$EXTRA_UBUNTU"
|
||||
|
||||
# Use the image as it comes, do not upgrade it, so that it stays reproducible.
|
||||
#RUN apt update && apt dist-upgrade -y
|
||||
|
||||
RUN apt update && apt install -y $PACKAGES $EXTRA_UBUNTU
|
||||
|
||||
COPY bin/main.sh /root/main.sh
|
||||
RUN chmod +x /root/main.sh
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# Construction Area
|
||||
|
||||
This configuration is still a work in progress. :)
|
||||
|
||||
# Provision Test Images
|
||||
|
||||
Create containers of popular Linux distributions in order to test Ansible.
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
sh -c "rm -rfv prov-test"
|
||||
|
||||
echo "Downloading Repo '$REPO' : Branch '$BRANCH'"
|
||||
git clone $REPO --branch=$BRANCH prov-test
|
||||
|
||||
cd prov-test
|
||||
|
||||
echo "Starting Executable Script"
|
||||
echo "Starting Executable Script '$EXEC'"
|
||||
|
||||
tail -F /var/mail/mail &
|
||||
tail -F /var/mail/ansible &
|
||||
|
||||
@@ -17,6 +17,9 @@ services:
|
||||
context: ./
|
||||
dockerfile: Dockerfiles/arch
|
||||
network: host
|
||||
args:
|
||||
PACKAGES: ${PACKAGES}
|
||||
EXTRA_ARCH: ${EXTRA_ARCH}
|
||||
restart: no
|
||||
environment:
|
||||
- PACKAGES=$PACKAGES
|
||||
@@ -43,6 +46,9 @@ services:
|
||||
context: ./
|
||||
dockerfile: Dockerfiles/debian
|
||||
network: host
|
||||
args:
|
||||
PACKAGES: ${PACKAGES}
|
||||
EXTRA_DEBIAN: ${EXTRA_DEBIAN}
|
||||
restart: no
|
||||
environment:
|
||||
- PACKAGES=$PACKAGES
|
||||
@@ -69,6 +75,9 @@ services:
|
||||
context: ./
|
||||
dockerfile: Dockerfiles/fedora
|
||||
network: host
|
||||
args:
|
||||
PACKAGES: ${PACKAGES}
|
||||
EXTRA_FEDORA: ${EXTRA_FEDORA}
|
||||
restart: no
|
||||
environment:
|
||||
- PACKAGES=$PACKAGES
|
||||
@@ -95,6 +104,9 @@ services:
|
||||
context: ./
|
||||
dockerfile: Dockerfiles/opensuse
|
||||
network: host
|
||||
args:
|
||||
PACKAGES: ${PACKAGES}
|
||||
EXTRA_OPENSUSE: ${EXTRA_OPENSUSE}
|
||||
restart: no
|
||||
environment:
|
||||
- PACKAGES=$PACKAGES
|
||||
@@ -121,6 +133,9 @@ services:
|
||||
context: ./
|
||||
dockerfile: Dockerfiles/ubuntu
|
||||
network: host
|
||||
args:
|
||||
PACKAGES: ${PACKAGES}
|
||||
EXTRA_UBUNTU: ${EXTRA_UBUNTU}
|
||||
restart: no
|
||||
environment:
|
||||
- PACKAGES=$PACKAGES
|
||||
@@ -1,4 +1,4 @@
|
||||
# This file should be renamed '.env' and have any private values modified.
|
||||
# This file will need renamed '.env' and have any private values modified.
|
||||
|
||||
COMPOSE_BAKE=true
|
||||
|
||||
@@ -7,8 +7,7 @@ CPU=0.2
|
||||
RAM=0.2G
|
||||
|
||||
## Storage
|
||||
#STORAGE_DIR=../../Volumes/ProvisionTests
|
||||
PT_STORAGE_DIR=/tmp/ProvisionTests
|
||||
PT_STORAGE_DIR=../../Volumes/IGNORED/ProvisionTests
|
||||
|
||||
## Packages
|
||||
PACKAGES="git bash curl sudo which"
|
||||
@@ -20,5 +19,5 @@ EXTRA_UBUNTU=""
|
||||
|
||||
## Script
|
||||
REPO=https://git.hyperling.com/me/env-ansible
|
||||
BRANCH=dev
|
||||
EXEC="./setup.sh -l"
|
||||
BRANCH=stage
|
||||
EXEC="./setup.sh -l -g -s"
|
||||
@@ -1,18 +1,13 @@
|
||||
#!/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"
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# Initial Setup Instructions
|
||||
|
||||
How to first begin using this subproject.
|
||||
|
||||
1. Move to the directory of this README.
|
||||
```
|
||||
$ cd $DOCKER_HOME/Config/ReverseProxy
|
||||
@@ -10,6 +12,7 @@ How to first begin using this subproject.
|
||||
# ./create_placeholder_certs.sh
|
||||
```
|
||||
1. Make any personal changes to `./config/nginx.conf`.
|
||||
1. Copy the example files as `docker-compose.yml` and `.env`.
|
||||
1. Build the project.
|
||||
```
|
||||
# docker compose build
|
||||
@@ -20,8 +23,8 @@ How to first begin using this subproject.
|
||||
```
|
||||
1. Verify it started correctly, no configuration file errors.
|
||||
```
|
||||
# docker logs reverseproxy-app-1
|
||||
# docker logs reverseproxy-certbot-1
|
||||
# docker logs rp-app
|
||||
# docker logs rp-certbot
|
||||
```
|
||||
1. Create the real certificates.
|
||||
```
|
||||
@@ -34,6 +37,7 @@ How to first begin using this subproject.
|
||||
```
|
||||
|
||||
## DO NOT
|
||||
|
||||
* Edit any configurations or website data inside the container. It is destroyed on each build.
|
||||
* Instead, modify the files in `./config/` then use the Update Config commands below.
|
||||
* Install any additional software inside of the container. It will not persist a down and up.
|
||||
@@ -41,36 +45,45 @@ How to first begin using this subproject.
|
||||
* Alternatively write a script such as `../Nextcloud/fixes.ksh` which is run after every upgrade.
|
||||
|
||||
# Other Commands
|
||||
|
||||
Tasks which will also likely come up while using this subproject.
|
||||
|
||||
## Stop
|
||||
|
||||
If the proxy needs turned off either stop or down may be used.
|
||||
|
||||
```
|
||||
# docker compose stop
|
||||
# docker compose down
|
||||
```
|
||||
|
||||
## Upgrade
|
||||
Upgrading the containers should be as easy as this:
|
||||
|
||||
Upgrading the containers is as easy as this:
|
||||
|
||||
```
|
||||
# docker compose down
|
||||
# docker compose pull
|
||||
# docker compose build
|
||||
# docker compose down
|
||||
# docker compose up -d
|
||||
```
|
||||
|
||||
## Update Config
|
||||
|
||||
Replace the configuration based on any new, updated, or removed files.
|
||||
This may be possible to do when the system is up, but the best results have come from going down and back up.
|
||||
This is essentially an upgrade but there is no pull.
|
||||
|
||||
```
|
||||
# docker compose down
|
||||
# docker compose build
|
||||
# docker compose down
|
||||
# docker compose up -d
|
||||
```
|
||||
|
||||
If wanted as a one-line command:
|
||||
|
||||
```
|
||||
# docker compose down && docker compose build && docker compose up -d
|
||||
# docker compose build && docker compose down && docker compose up -d
|
||||
```
|
||||
|
||||
## Add New Config
|
||||
@@ -80,4 +93,4 @@ If wanted as a one-line command:
|
||||
1. Restart the project based on Update Config above.
|
||||
1. (Optional) Now you may run the letsencrypt script for a real certificate.
|
||||
1. (Optional) Run another Update Config to make sure the certs are loaded.
|
||||
1. Done! If set up correctly the site should be live.
|
||||
1. Done! If set up correctly the site will be live.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 2024-12-31 Hyperling
|
||||
# A dummy test file since true scripts are being kept private.
|
||||
# This should help anyone understand how the project is being used.
|
||||
# This will help anyone understand how the project is being used.
|
||||
|
||||
## Instructions ##
|
||||
# Add this without the comment to your /etc/hosts to test that it is working,
|
||||
@@ -11,9 +11,9 @@
|
||||
# cd $DOCKER_HOME/Config/ReverseProxy && docker compose build && docker compose up -d
|
||||
# Then from the system with the modified /etc/hosts,
|
||||
# curl --insecure git.example.com
|
||||
# You should see activity in the container log as well as the contents of the
|
||||
# You will see activity in the container log as well as the contents of the
|
||||
# proxied website in the terminal, NOT git.example.com. If using a browser then you
|
||||
# should notice that the URL is still git.example.com but the website is correct.
|
||||
# will notice that the URL is still git.example.com but the website is correct.
|
||||
|
||||
# Force HTTPS
|
||||
server {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 2023-07-08 Hyperling
|
||||
# A dummy test file since true scripts are being kept private.
|
||||
# This should help anyone understand how the project is being used.
|
||||
# This will help anyone understand how the project is being used.
|
||||
|
||||
## Instructions ##
|
||||
# Add this without the comment to your /etc/hosts to test that it is working,
|
||||
@@ -11,9 +11,9 @@
|
||||
# cd $DOCKER_HOME/Config/ReverseProxy && docker compose build && docker compose up -d
|
||||
# Then from the system with the modified /etc/hosts,
|
||||
# curl --insecure html.example.com
|
||||
# You should see activity in the container log as well as the contents of the
|
||||
# proxied website in the terminal, NOT html.example.com. If using a browser then you
|
||||
# should notice that the URL is still html.example.com but the website is correct.
|
||||
# You will see activity in the container log as well as the contents of the
|
||||
# proxied website in the terminal, NOT git.example.com. If using a browser then you
|
||||
# will notice that the URL is still git.example.com but the website is correct.
|
||||
|
||||
# Force HTTPS
|
||||
server {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 2025-01-02 Hyperling
|
||||
# A dummy test file since true scripts are being kept private.
|
||||
# This should help others understand how to get Nextcloud working.
|
||||
# This will help others understand how to get Nextcloud working.
|
||||
|
||||
## Instructions ##
|
||||
# Add this without the comment to your /etc/hosts to test that it is working,
|
||||
@@ -11,9 +11,9 @@
|
||||
# cd $DOCKER_HOME/Config/ReverseProxy && docker compose build && docker compose up -d
|
||||
# Then from the system with the modified /etc/hosts,
|
||||
# curl --insecure cloud.example.com
|
||||
# You should see activity in the container log as well as the contents of the
|
||||
# proxied website in the terminal, NOT cloud.example.com. If using a browser then you
|
||||
# should notice that the URL is still cloud.example.com but the website is correct.
|
||||
# You will see activity in the container log as well as the contents of the
|
||||
# proxied website in the terminal, NOT git.example.com. If using a browser then you
|
||||
# will notice that the URL is still git.example.com but the website is correct.
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 2022-10-05 Hyperling
|
||||
# A dummy test file since true scripts are being kept private.
|
||||
# This should help anyone understand how the project is being used.
|
||||
# This will help anyone understand how the project is being used.
|
||||
|
||||
## Instructions ##
|
||||
# Add this without the comment to your /etc/hosts to test that it is working,
|
||||
@@ -11,9 +11,9 @@
|
||||
# cd $DOCKER_HOME/Config/ReverseProxy && docker compose build && docker compose up -d
|
||||
# Then from the system with the modified /etc/hosts,
|
||||
# curl --insecure proxy.example.com
|
||||
# You should see activity in the container log as well as the contents of the
|
||||
# You will see activity in the container log as well as the contents of the
|
||||
# proxied website in the terminal, NOT proxy.example.com. If using a browser then you
|
||||
# should notice that the URL is still proxy.example.com but the website is correct.
|
||||
# will notice that the URL is still proxy.example.com but the website is correct.
|
||||
|
||||
# Force HTTPS
|
||||
server {
|
||||
@@ -67,7 +67,7 @@ server {
|
||||
# Or alternatively, do it like the force of HTTPS if not your server.
|
||||
#return 301 https://website.name/$request_uri;
|
||||
|
||||
# This should forward you from 'proxy.example.com' to a real site:
|
||||
# This will forward you from 'proxy.example.com' to a real site:
|
||||
proxy_pass https://hyperling.com;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
If the reverse proxy also serves static HTML sites, the root directories of each
|
||||
can be placed here. Then in `../conf.d` add a file which points the domain to
|
||||
the HTML web root, such as `/etc/nginx/html/www.website.name`. An example for
|
||||
this exists called `html.example.com`. It should be fairly easy to recreate for
|
||||
this exists called `html.example.com`. It is fairly easy to recreate for
|
||||
another website.
|
||||
|
||||
@@ -24,8 +24,8 @@ services:
|
||||
mode: global
|
||||
resources:
|
||||
limits:
|
||||
cpus: '0.20'
|
||||
memory: 64M
|
||||
cpus: $CPU
|
||||
memory: $MEM
|
||||
|
||||
certbot:
|
||||
container_name: rp-certbot
|
||||
@@ -39,5 +39,5 @@ services:
|
||||
mode: global
|
||||
resources:
|
||||
limits:
|
||||
cpus: '0.10'
|
||||
memory: 32M
|
||||
cpus: $CPU_LE
|
||||
memory: $MEM_LE
|
||||
@@ -1,49 +0,0 @@
|
||||
# 2022-10-05 Hyperling
|
||||
# Reverse Proxy with LetsEncrypt Certbot.
|
||||
# This is a revised version of these works:
|
||||
# https://phoenixnap.com/kb/docker-nginx-reverse-proxy
|
||||
# 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
|
||||
|
||||
services:
|
||||
|
||||
app:
|
||||
container_name: rp-app
|
||||
build:
|
||||
context: ./
|
||||
network: host
|
||||
restart: always
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
volumes:
|
||||
- ../../Volumes/ReverseProxy/letsencrypt:/etc/nginx/letsencrypt
|
||||
- ../../Volumes/ReverseProxy/letsencrypt-certs:/etc/nginx/certs
|
||||
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
|
||||
deploy:
|
||||
mode: global
|
||||
resources:
|
||||
limits:
|
||||
cpus: '1.00'
|
||||
memory: 512M
|
||||
reservations:
|
||||
cpus: '0.25'
|
||||
memory: 128M
|
||||
|
||||
certbot:
|
||||
container_name: rp-certbot
|
||||
image: certbot/certbot
|
||||
restart: always
|
||||
volumes:
|
||||
- ../../Volumes/ReverseProxy/letsencrypt:/etc/letsencrypt
|
||||
- ../../Volumes/ReverseProxy/letsencrypt-certs:/etc/letsencrypt/nginx
|
||||
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; cp -rL /etc/letsencrypt/live/* /etc/letsencrypt/nginx/; sleep 12h & wait $${!}; done;'"
|
||||
deploy:
|
||||
mode: global
|
||||
resources:
|
||||
limits:
|
||||
cpus: '0.50'
|
||||
memory: 256M
|
||||
reservations:
|
||||
cpus: '0.25'
|
||||
memory: 128M
|
||||
19
Config/ReverseProxy/example.env
Normal file
19
Config/ReverseProxy/example.env
Normal file
@@ -0,0 +1,19 @@
|
||||
# This file will need copied as `.env` and adjusted as necessary.
|
||||
|
||||
## Docker ##
|
||||
|
||||
COMPOSE_BAKE=true
|
||||
|
||||
## Performance ##
|
||||
|
||||
# Micro Server
|
||||
CPU=0.10
|
||||
MEM=0.10G
|
||||
CPU_LE=0.05
|
||||
MEM_LE=0.05G
|
||||
|
||||
# Capable Server
|
||||
#CPU=0.50
|
||||
#MEM=0.50G
|
||||
#CPU_LE=0.25
|
||||
#MEM_LE=0.25G
|
||||
11
Config/Sandbox/docker-compose.example.yml
Normal file
11
Config/Sandbox/docker-compose.example.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
# 2025-11-11 Hyperling
|
||||
# Basic container for testing commands in a blank slate environment.
|
||||
|
||||
services:
|
||||
app:
|
||||
container_name: sandbox
|
||||
image: debian:trixie-slim
|
||||
command: "tail -F /var/mail/*"
|
||||
working_dir: /root
|
||||
volumes:
|
||||
- ../../Volumes/Sandbox/root-shared:/root/shared
|
||||
3
Config/WordpressExample/README.md
Normal file
3
Config/WordpressExample/README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# Construction Area
|
||||
|
||||
This configuration is still a work in progress. :)
|
||||
76
Config/WordpressExample/docker-compose.example.yml
Normal file
76
Config/WordpressExample/docker-compose.example.yml
Normal file
@@ -0,0 +1,76 @@
|
||||
# 2025-10-17 Hyperling
|
||||
# Copied and modified from the example here:
|
||||
# https://hub.docker.com/_/wordpress
|
||||
# This file needs copied to `docker-compose.yml`.
|
||||
# Most configration changes can be done in the env file rather than here.
|
||||
|
||||
## TBDs ##
|
||||
# - Move env variables to env.example
|
||||
# - Look through other environment variables which may be useful.
|
||||
# - Add CPU and MEM section
|
||||
# - Change ports
|
||||
|
||||
# TBD locate these at ../../Volumes and create `prep.sh` script.
|
||||
#volumes:
|
||||
# wordpress:
|
||||
# db:
|
||||
|
||||
services:
|
||||
|
||||
app:
|
||||
container_name: wp-app
|
||||
image: wordpress:latest
|
||||
restart: always
|
||||
ports:
|
||||
- 8080:80
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
links:
|
||||
- db
|
||||
volumes:
|
||||
- ../../Volumes/WordPress/wordpress:/var/www/html
|
||||
environment:
|
||||
WORDPRESS_ADMIN_USERNAME: $WORDPRESS_ADMIN_USERNAME
|
||||
WORDPRESS_ADMIN_PASSWORD: $WORDPRESS_ADMIN_PASSWORD
|
||||
WORDPRESS_DB_HOST: wp-db
|
||||
WORDPRESS_DB_NAME: $MARIADB_DATABASE
|
||||
# TBD/TODO: Does not work, but recommended. :(
|
||||
#WORDPRESS_DB_USER: $MARIADB_USER
|
||||
#WORDPRESS_DB_PASSWORD: $MARIADB_PASSWORD
|
||||
# Works, but not recommended. Lol.
|
||||
WORDPRESS_DB_USER: root
|
||||
WORDPRESS_DB_PASSWORD: $MARIADB_ROOT_PASSWORD
|
||||
WORDPRESS_DEBUG: $WORDPRESS_DEBUG
|
||||
deploy:
|
||||
mode: global
|
||||
resources:
|
||||
limits:
|
||||
cpus: $WP_CPU
|
||||
memory: $WP_MEM
|
||||
|
||||
db:
|
||||
container_name: wp-db
|
||||
image: mariadb:lts
|
||||
restart: always
|
||||
volumes:
|
||||
- ../../Volumes/WordPress/mariadb:/var/lib/mysql
|
||||
healthcheck:
|
||||
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
|
||||
start_period: 5s
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
environment:
|
||||
# https://mariadb.com/docs/server/server-management/automated-mariadb-deployment-and-administration/docker-and-mariadb/mariadb-server-docker-official-image-environment-variables
|
||||
MARIADB_DATABASE: $MARIADB_DATABASE
|
||||
MARIADB_USER: $MARIADB_USER
|
||||
MARIADB_PASSWORD: MARIADB_PASSWORD
|
||||
MARIADB_ROOT_PASSWORD: $MARIADB_ROOT_PASSWORD
|
||||
MARIADB_AUTO_UPGRADE: $MARIADB_AUTO_UPGRADE
|
||||
deploy:
|
||||
mode: global
|
||||
resources:
|
||||
limits:
|
||||
cpus: $WP_CPU_DB
|
||||
memory: $WP_MEM_DB
|
||||
63
Config/WordpressExample/example.env
Normal file
63
Config/WordpressExample/example.env
Normal file
@@ -0,0 +1,63 @@
|
||||
# This file needs copied to `.env` and have its values changes as needed.
|
||||
|
||||
## Docker ##
|
||||
|
||||
COMPOSE_BAKE=true
|
||||
|
||||
## End Docker ##
|
||||
|
||||
|
||||
## WordPress ##
|
||||
|
||||
# TBD/TODO: These do not actually seem to work.
|
||||
WORDPRESS_ADMIN_USERNAME='wp_user'
|
||||
WORDPRESS_ADMIN_PASSWORD='wordpress_password'
|
||||
|
||||
# Uncomment this to get debug output in the log.
|
||||
WORDPRESS_DEBUG=1
|
||||
|
||||
## End WordPress ##
|
||||
|
||||
|
||||
## Database ##
|
||||
|
||||
MARIADB_DATABASE='wordpress'
|
||||
|
||||
MARIADB_USER='db_user'
|
||||
MARIADB_PASSWORD='database_password'
|
||||
|
||||
MARIADB_ROOT_PASSWORD='db_root_password'
|
||||
|
||||
# Comment this if you do not want MariaDB to run upgrade scripts on new versions.
|
||||
MARIADB_AUTO_UPGRADE=1
|
||||
|
||||
## End Database ##
|
||||
|
||||
|
||||
## Performance ##
|
||||
|
||||
# Standard Minimum
|
||||
#WP_CPU=1.00
|
||||
#WP_MEM=2.00G
|
||||
#WP_CPU_DB=1.00
|
||||
#WP_MEM_DB=1.00G
|
||||
|
||||
# Standard Recommended
|
||||
#WP_CPU=1.00
|
||||
#WP_MEM=4.00G
|
||||
#WP_CPU_DB=1.00
|
||||
#WP_MEM_DB=0.50G
|
||||
|
||||
# Tested Minimum
|
||||
#WP_CPU=0.35
|
||||
#WP_MEM=0.35G
|
||||
#WP_CPU_DB=0.15
|
||||
#WP_MEM_DB=0.15G
|
||||
|
||||
# Tested Recommended
|
||||
WP_CPU=0.50
|
||||
WP_MEM=0.50G
|
||||
WP_CPU_DB=0.25
|
||||
WP_MEM_DB=0.25G
|
||||
|
||||
## End Performance ##
|
||||
15
README.md
15
README.md
@@ -1,18 +1,22 @@
|
||||
# My Docker Setup
|
||||
|
||||
Scripting my way into the Docker world. I was unable to find a good tutorial on
|
||||
using and managing containers so this is what made sense to me based on practice
|
||||
with `docker-compose`. Also has some usages of `Dockerfile` to build some apps.
|
||||
|
||||
## Disclaimer
|
||||
|
||||
Currently the project only focuses on `apt` based operating systems, and is
|
||||
being used in production by the latest Debian release.
|
||||
|
||||
## Other README's
|
||||
|
||||
Each `Config/PROJECT/` folder also contains its own README file with specific
|
||||
information to running that sub project. This file's job is to cover the general
|
||||
Docker installation. The others then contain details on their program setup.
|
||||
|
||||
## How To Use
|
||||
|
||||
Most of these commands benefit from being root. Something like a `sudo su -` if
|
||||
you feel comfortable with it. Otherwise be aware that using sudo may cause file
|
||||
permission conflicts when interacting with the configuration files and folders.
|
||||
@@ -70,17 +74,20 @@ Cross your fingers and hope to succeed!
|
||||
## Folders
|
||||
|
||||
### Config
|
||||
Compose projects are set up here. Each folder should have a `docker-compose.yml`
|
||||
file set up unless it is for utility such as DynamicDNS, which is used in CRON.
|
||||
|
||||
Compose projects are set up here. Each folder needs `docker-compose.yml` and `.env`
|
||||
files set up unless it is for utility such as DynamicDNS, which is used in CRON.
|
||||
|
||||
### Volumes
|
||||
|
||||
The data of the files go here if the Config is done correctly. I think this
|
||||
should be easier to remember than `/var/lib/docker/volumes` when it comes time
|
||||
will be easier to remember than `/var/lib/docker/volumes` when it comes time
|
||||
for migrations. Hopefully all that'd be needed is to rsync `/opt/Docker` and run
|
||||
`install.sh` and then `start.sh` on the new server. You are welcome to use a
|
||||
directory other than `/opt/Docker`, this project is location agnostic.
|
||||
|
||||
### bin
|
||||
|
||||
Scripts to help make life easier. Some are pretty basic, but others do nice
|
||||
things like handle the container IDs.
|
||||
- `create.sh`
|
||||
@@ -94,4 +101,4 @@ things like handle the container IDs.
|
||||
- Start, stop, update, rebuild, etc all compose containers.
|
||||
- `uninstall.sh`
|
||||
- If something goes wrong and you'd like to start from scratch without
|
||||
provisioning a new server then this should do the job.
|
||||
provisioning a new server then this will do the job.
|
||||
|
||||
16
Volumes/IGNORED/README.md
Normal file
16
Volumes/IGNORED/README.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# Volumes/IGNORED/README.md
|
||||
|
||||
Docker volumes which do not need included in backups and are safe to delete
|
||||
during downtime without harming the integrity of the application they support
|
||||
can be directed here.
|
||||
|
||||
Examples could be:
|
||||
|
||||
- LibreTranslate's models
|
||||
- These can be downloaded at any time and do not need recovered.
|
||||
- Provision Tests
|
||||
- These are test VMs which ensure privisionin scrips work proeprly.
|
||||
They are meant to be disposed of frequently and recrated from scratch.
|
||||
|
||||
If working on test VMs, such as a dev or stage Nextcloud that shouldn't be
|
||||
taking up backup space, this would also be a good place for them.
|
||||
@@ -5,7 +5,7 @@
|
||||
DIR="$(dirname -- "${BASH_SOURCE[0]}")"
|
||||
PROG="$(basename -- "${BASH_SOURCE[0]}")"
|
||||
echo "$DIR/$PROG"
|
||||
source $DIR/../source.env
|
||||
source "$DIR/../source.env"
|
||||
|
||||
## Variables ##
|
||||
|
||||
@@ -16,6 +16,39 @@ BASENAME="Backup"
|
||||
file="$BACKUP_DIR/$BASENAME.$DATE.$HOSTNAME.$TAG.zip"
|
||||
time="`which time`"
|
||||
|
||||
## Functions ##
|
||||
|
||||
function usage {
|
||||
cat <<- EOF
|
||||
Backup script for Hyperling's self-managed Docker setup.
|
||||
|
||||
Usage: $PROG [-u] [-d] [-h]
|
||||
-u : Bring all containers up after the backup has finished.
|
||||
-d : Bring all containers down before taking the backup.
|
||||
-h : Display this help text.
|
||||
|
||||
Example:
|
||||
$PROG -ud
|
||||
EOF
|
||||
|
||||
exit $1
|
||||
}
|
||||
|
||||
## Parameters ##
|
||||
|
||||
up=FALSE
|
||||
down=FALSE
|
||||
|
||||
while getopts ':udh' opt; do
|
||||
case "$opt" in
|
||||
u) up=TRUE ;;
|
||||
d) down=TRUE ;;
|
||||
h) usage 0 ;;
|
||||
*) echo "ERROR: Option $OPTARG not recognized." >&2
|
||||
usage 1 ;;
|
||||
esac
|
||||
done
|
||||
|
||||
## Main ##
|
||||
|
||||
# Ensure backup directory exists with correct permissions.
|
||||
@@ -30,24 +63,34 @@ 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
|
||||
if [[ "$down" == "TRUE" ]]; then
|
||||
echo -e "\n`date` - Take down services for a cold backup."
|
||||
manage.sh -d
|
||||
else
|
||||
echo -e "\n`date` - Skipping take down."
|
||||
fi
|
||||
|
||||
echo -e "\n`date` - Create the backup for '$DOCKER_HOME'."
|
||||
$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
|
||||
$time zip -r "$file.tmp" \
|
||||
"$DOCKER_HOME" \
|
||||
/etc/crontab /etc/cron.d \
|
||||
/var/spool/cron /var/{log,mail} \
|
||||
--exclude "$DOCKER_HOME/Volumes/IGNORED/*" \
|
||||
1>/dev/null
|
||||
mv -v "$file.tmp" "$file"
|
||||
|
||||
echo -e "\n`date` - Done with zipping, check size."
|
||||
ls -sh $file
|
||||
ls -sh "$file"
|
||||
|
||||
echo -e "\n`date` - Ensure other users can access the file."
|
||||
chmod -v 755 $file
|
||||
chmod -v 755 "$file"
|
||||
|
||||
echo -e "\n`date` - Bring services back up."
|
||||
manage.sh -u
|
||||
if [[ "$up" == "TRUE" ]]; then
|
||||
echo -e "\n`date` - Bring services back up."
|
||||
manage.sh -u
|
||||
else
|
||||
echo -e "\n`date` - Skipping restoring services."
|
||||
fi
|
||||
|
||||
## Finish ##
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ function usage() {
|
||||
# 1) The exit code used when leaving.
|
||||
exit_code=$1
|
||||
echo ""
|
||||
echo -n "Usage: $PROG [-A ( -u | -d | -b | -p | -c | -s )] " 1>&2
|
||||
echo -n "Usage: $PROG [-A ( -u | -d | -b | -p | -c | -m | -s )] " 1>&2
|
||||
echo "[-i CONTAINER] [-l CONTAINER] [-h]" 1>&2
|
||||
cat <<- EOF
|
||||
|
||||
@@ -26,7 +26,7 @@ function usage() {
|
||||
Parameters - Standalone:
|
||||
|
||||
(ALL)
|
||||
-A : Equivalent of specifying '-udbpcs' for a full upgrade service.
|
||||
-A : Equivalent of specifying '-udbpcms' for a full upgrade service.
|
||||
|
||||
(UP)
|
||||
-u : Start all containers with 'up -d'.
|
||||
@@ -43,6 +43,9 @@ function usage() {
|
||||
(CLEAN)
|
||||
-c : Remove any abandoned Docker objects using the 'prune' commands.
|
||||
|
||||
(MAINTENANCE)
|
||||
-m : Run any maintenance and/or purge scripts for each subproject.
|
||||
|
||||
(STATS)
|
||||
-s : Tune in to the 'stats' of how each container is running.
|
||||
|
||||
@@ -86,7 +89,7 @@ function check_container() {
|
||||
|
||||
## Parameters ##
|
||||
|
||||
while getopts ':Audbpcsi:l:h' opt; do
|
||||
while getopts ':Audbpcsi:l:mh' opt; do
|
||||
case $opt in
|
||||
A) all="Y" ;;
|
||||
u) up="Y" ;;
|
||||
@@ -97,30 +100,31 @@ while getopts ':Audbpcsi:l:h' opt; do
|
||||
s) stats="Y" ;;
|
||||
i) interact="$OPTARG" ;;
|
||||
l) logs="$OPTARG" ;;
|
||||
m) maintenance="Y" ;;
|
||||
h) usage 0 ;;
|
||||
*) echo "ERROR: Parameter '$OPTARG' not recognized." 1>&2 && usage 1 ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# This is done outside the getopts for readability.
|
||||
if [[ -n $all ]]; then
|
||||
up="Y"; down="Y"; build="Y"; pull="Y"; clean="Y"; stats="Y"
|
||||
if [[ -n "$all" && "$all" == "Y" ]]; then
|
||||
up="Y"; down="Y"; build="Y"; pull="Y"; clean="Y"; stats="Y"; maintenance="Y"
|
||||
fi
|
||||
|
||||
## Validations ##
|
||||
|
||||
# Script will behave poorly if not run with admin privileges.
|
||||
if [[ $LOGNAME != "root" ]]; then
|
||||
if [[ "$LOGNAME" != "root" ]]; then
|
||||
echo "*************************************************************"
|
||||
echo "WARNING: Script is intended for root. Please su or sudo/doas."
|
||||
echo "*************************************************************"
|
||||
fi
|
||||
|
||||
# Options which only work if the container exists or is going to be started.
|
||||
if [[ -n $interact ]]; then
|
||||
if [[ -n "$interact" ]]; then
|
||||
check_container $interact interaction
|
||||
fi
|
||||
if [[ -n $logs ]]; then
|
||||
if [[ -n "$logs" ]]; then
|
||||
check_container $logs logs
|
||||
fi
|
||||
|
||||
@@ -128,14 +132,14 @@ fi
|
||||
|
||||
# If no parameters are passed, list all the containers which are running.
|
||||
if [[ -z $up && -z $down && -z $build && -z $pull && -z $clean
|
||||
&& -z $interact && -z $logs && -z $stats
|
||||
&& -z $interact && -z $logs && -z $stats && -z $maintenance
|
||||
]]; then
|
||||
docker ps --size
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Otherwise, loop through all the subproject configurations.
|
||||
if [[ -n $up || -n $down || -n $build || -n $pull ]]; then
|
||||
if [[ -n $up || -n $down || -n $build || -n $pull || -n $maintenance ]]; then
|
||||
cd $DOCKER_HOME/Config
|
||||
for dir in `ls`; do
|
||||
# If this is a directory, enter it, otherwise skip to the next listing.
|
||||
@@ -143,10 +147,10 @@ if [[ -n $up || -n $down || -n $build || -n $pull ]]; then
|
||||
echo ""
|
||||
pwd
|
||||
|
||||
# Ensure .env files exist so that all compose variables are populated.
|
||||
if [[ -e ./env.standard && ! -e ./.env ]]; then
|
||||
echo "WARNING: .env file was not found, copying standard as placeholder."
|
||||
cp -v env.standard .env
|
||||
# Ensure env file exists so that all compose variables are populated.
|
||||
if [[ -e ./example.env && ! -e ./.env ]]; then
|
||||
echo "WARNING: .env file was not found, copying example as placeholder."
|
||||
cp -v example.env .env
|
||||
fi
|
||||
|
||||
# Ensure all configuration files have been created.
|
||||
@@ -160,9 +164,19 @@ if [[ -n $up || -n $down || -n $build || -n $pull ]]; then
|
||||
done
|
||||
fi
|
||||
|
||||
# Shut off container.
|
||||
if [[ $down == "Y" ]]; then
|
||||
[ -e docker-compose.yml ] && docker compose down
|
||||
# Run the prep script to create any necessary volumes.
|
||||
if [[ -f prep.sh ]]; then
|
||||
./prep.sh
|
||||
fi
|
||||
|
||||
# Run any maintenance scripts associate with the container.
|
||||
if [[ "$maintenance" == "Y" ]]; then
|
||||
if [[ -f "maintenance.sh" ]]; then
|
||||
./maintenance.sh
|
||||
fi
|
||||
if [[ -f "purge.sh" ]]; then
|
||||
./purge.sh
|
||||
fi
|
||||
fi
|
||||
|
||||
# Update container from remote source such as Docker Hub.
|
||||
@@ -175,6 +189,11 @@ if [[ -n $up || -n $down || -n $build || -n $pull ]]; then
|
||||
[ -e Dockerfile ] && docker compose build
|
||||
fi
|
||||
|
||||
# Shut off container.
|
||||
if [[ $down == "Y" ]]; then
|
||||
[ -e docker-compose.yml ] && docker compose down
|
||||
fi
|
||||
|
||||
# Run the container as a daemon.
|
||||
if [[ $up == "Y" ]]; then
|
||||
[ -e docker-compose.yml ] && docker compose up -d
|
||||
@@ -200,6 +219,9 @@ if [[ -n $clean ]]; then
|
||||
docker network prune
|
||||
docker builder prune -a
|
||||
docker system df
|
||||
echo "Syncing."
|
||||
sync
|
||||
sleep 5
|
||||
fi
|
||||
|
||||
# Follow the logs of a container.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/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.
|
||||
# the machine holding the backups in the directory that it needs to land.
|
||||
|
||||
DIR="$(dirname -- "${BASH_SOURCE[0]}")"
|
||||
PROG="$(basename -- "${BASH_SOURCE[0]}")"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# The entries below should be added to the root crontab, taking into account
|
||||
# The entries below need to be added to the root crontab, taking into account
|
||||
# where you have placed your Docker Home. This assumes `/opt/Docker`.
|
||||
|
||||
## Dynamic DNS ##
|
||||
|
||||
Reference in New Issue
Block a user