Compare commits
No commits in common. '8b967409d094d6a8d46e10e7451ea027c92b5fc9' and '81d531a697689dcf21da623d97c7b4d6d49fca80' have entirely different histories.
8b967409d0
...
81d531a697
@ -1,2 +0,0 @@
|
|||||||
run:
|
|
||||||
sudo docker-compose -f docker-compose.yaml $(find . -mindepth 2 -maxdepth 2 -type f -name docker-compose.yaml -exec echo -f {} \;) up
|
|
@ -1,13 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=Main App
|
|
||||||
After=docker.service
|
|
||||||
Requires=docker.service
|
|
||||||
[Service]
|
|
||||||
TimeoutStartSec=0
|
|
||||||
ExecStart=/bin/bash -c '/usr/bin/docker compose -f /app/docker-compose.yaml $(find /app -mindepth 2 -maxdepth 2 -type f -name docker-compose.yaml -exec echo -f {} \;) up'
|
|
||||||
ExecStop=/bin/bash -c '/usr/bin/docker compose -f /app/docker-compose.yaml $(find /app -mindepth 2 -maxdepth 2 -type f -name docker-compose.yaml -exec echo -f {} \;) stop'
|
|
||||||
|
|
||||||
Restart=always
|
|
||||||
RestartSec=5s
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
@ -1,25 +0,0 @@
|
|||||||
version: '3'
|
|
||||||
services:
|
|
||||||
lb:
|
|
||||||
image: docker.io/caddy:2
|
|
||||||
volumes:
|
|
||||||
# - /app/lb:/etc/caddy
|
|
||||||
- ./lb/:/etc/caddy
|
|
||||||
- config:/config
|
|
||||||
- data:/data
|
|
||||||
networks:
|
|
||||||
- lb
|
|
||||||
restart: unless-stopped
|
|
||||||
ports:
|
|
||||||
- "443:443"
|
|
||||||
- "80:80"
|
|
||||||
nginx:
|
|
||||||
image: nginx
|
|
||||||
restart: unless-stopped
|
|
||||||
networks:
|
|
||||||
- lb
|
|
||||||
networks:
|
|
||||||
lb:
|
|
||||||
volumes:
|
|
||||||
config:
|
|
||||||
data:
|
|
@ -1,50 +0,0 @@
|
|||||||
version: '3'
|
|
||||||
|
|
||||||
services:
|
|
||||||
db:
|
|
||||||
image: postgres
|
|
||||||
shm_size: 128mb
|
|
||||||
restart: always
|
|
||||||
volumes:
|
|
||||||
- db:/var/lib/postgresql/data
|
|
||||||
environment:
|
|
||||||
- POSTGRES_DB=nextcloud
|
|
||||||
- POSTGRES_USER=nextcloud
|
|
||||||
- POSTGRES_PASSWORD=password
|
|
||||||
networks:
|
|
||||||
- internal
|
|
||||||
redis:
|
|
||||||
image: redis:alpine
|
|
||||||
restart: always
|
|
||||||
networks:
|
|
||||||
- internal
|
|
||||||
nextcloud:
|
|
||||||
image: nextcloud
|
|
||||||
environment:
|
|
||||||
- POSTGRES_HOST=db
|
|
||||||
- POSTGRES_DB=nextcloud
|
|
||||||
- POSTGRES_USER=nextcloud
|
|
||||||
- POSTGRES_PASSWORD=password
|
|
||||||
- NEXTCLOUD_ADMIN_PASSWORD=password
|
|
||||||
- NEXTCLOUD_ADMIN_USER=admin
|
|
||||||
- REDIS_HOST=redis
|
|
||||||
- NEXTCLOUD_TRUSTED_DOMAINS=nextcloud1.nassella.cc
|
|
||||||
ports:
|
|
||||||
- "8080:80"
|
|
||||||
depends_on:
|
|
||||||
- redis
|
|
||||||
- db
|
|
||||||
networks:
|
|
||||||
- lb
|
|
||||||
- internal
|
|
||||||
volumes:
|
|
||||||
- nextcloud:/var/www
|
|
||||||
restart: unless-stopped
|
|
||||||
networks:
|
|
||||||
lb:
|
|
||||||
internal:
|
|
||||||
driver: bridge
|
|
||||||
internal: true
|
|
||||||
volumes:
|
|
||||||
db:
|
|
||||||
nextcloud:
|
|
@ -1,37 +0,0 @@
|
|||||||
version: '3'
|
|
||||||
services:
|
|
||||||
wg-easy:
|
|
||||||
image: ghcr.io/wg-easy/wg-easy:15
|
|
||||||
environment:
|
|
||||||
- PORT=80
|
|
||||||
ports:
|
|
||||||
- "51820:51820/udp"
|
|
||||||
networks:
|
|
||||||
lb:
|
|
||||||
wg:
|
|
||||||
ipv4_address: 10.42.42.42
|
|
||||||
# ipv6_address: fdcc:ad94:bacf:61a3::2a
|
|
||||||
volumes:
|
|
||||||
- etc_wireguard:/etc/wireguard
|
|
||||||
- /lib/modules:/lib/modules:ro
|
|
||||||
restart: unless-stopped
|
|
||||||
cap_add:
|
|
||||||
- NET_ADMIN
|
|
||||||
- SYS_MODULE
|
|
||||||
sysctls:
|
|
||||||
- net.ipv4.ip_forward=1
|
|
||||||
- net.ipv4.conf.all.src_valid_mark=1
|
|
||||||
- net.ipv6.conf.all.disable_ipv6=0
|
|
||||||
- net.ipv6.conf.all.forwarding=1
|
|
||||||
- net.ipv6.conf.default.forwarding=1
|
|
||||||
networks:
|
|
||||||
lb:
|
|
||||||
wg:
|
|
||||||
driver: bridge
|
|
||||||
ipam:
|
|
||||||
driver: default
|
|
||||||
config:
|
|
||||||
- subnet: 10.42.42.0/24
|
|
||||||
- subnet: fdcc:ad94:bacf:61a3::/64
|
|
||||||
volumes:
|
|
||||||
etc_wireguard:
|
|
@ -1,2 +0,0 @@
|
|||||||
ROOT_DOMAIN=example.com
|
|
||||||
APP_CONFIGS="nextcloud,nextcloud wg-easy,wg-easy"
|
|
@ -0,0 +1,12 @@
|
|||||||
|
# get the directory of this makefile
|
||||||
|
ROOT_DIR:=$(shell dirname "$(realpath $(firstword $(MAKEFILE_LIST)))")
|
||||||
|
|
||||||
|
ignition:
|
||||||
|
cat cl.yaml | sudo docker run --rm --volume /home/tjhintz/.ssh/id_rsa.pub:/pwd/ssh-keys --volume ${ROOT_DIR}:/pwd --workdir /pwd -i quay.io/coreos/butane:latest -d /pwd > ignition.json
|
||||||
|
|
||||||
|
build:
|
||||||
|
cp --reflink=auto flatcar_production_qemu_image.img.fresh flatcar_production_qemu_image.img
|
||||||
|
make ignition
|
||||||
|
|
||||||
|
run:
|
||||||
|
./flatcar_production_qemu.sh -i ignition.json
|
@ -1,42 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# this script generates the load-balancer
|
|
||||||
# config for the Caddy server.
|
|
||||||
|
|
||||||
# it depends on apps.config which should define:
|
|
||||||
# ROOT_DOMAIN - the root domain for all apps
|
|
||||||
# APP_CONFIGS - app-subdomain pairs, configured via a comma, like:
|
|
||||||
# app1,subdomain1 app2,subdomain2 app3,subdomain3
|
|
||||||
# full example:
|
|
||||||
# ROOT_DOMAIN=nassella.cc
|
|
||||||
# APP_CONFIGS="app1,subdomain1 app2,subdomain2 app3,subdomain3"
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
. apps.config
|
|
||||||
|
|
||||||
read -r -a APP_CONFIGS <<< "$APP_CONFIGS"
|
|
||||||
APP_CONFIGS+=('lb,root')
|
|
||||||
|
|
||||||
|
|
||||||
declare -A bodys
|
|
||||||
bodys["nextcloud"]=" reverse_proxy http://nextcloud:80"
|
|
||||||
bodys["wg-easy"]=" reverse_proxy http://wg-easy:80"
|
|
||||||
bodys["lb"]=" reverse_proxy http://nginx:80"
|
|
||||||
|
|
||||||
for config_string in ${APP_CONFIGS[@]}; do
|
|
||||||
IFS=','
|
|
||||||
read -r -a config <<< "$config_string"
|
|
||||||
|
|
||||||
app=${config[0]}
|
|
||||||
subdomain=${config[1]}
|
|
||||||
body=${bodys[$app]}
|
|
||||||
fulldomain="$subdomain.$ROOT_DOMAIN"
|
|
||||||
|
|
||||||
echo "$fulldomain {"
|
|
||||||
echo $body
|
|
||||||
echo "}"
|
|
||||||
done
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue