feat: migrate stack to Portainer git-managed, rename project to valhalla-lab

- Rename project from htpc-download-box to valhalla-lab (directory + dc alias)
- Remove portainer and watchtower from compose; run standalone outside managed stack
  to prevent self-termination during Portainer-triggered redeployments
- Add portainer_proxy external network shared by caddy and standalone portainer
  so Caddy can route to Portainer via Docker DNS without them being in the same stack
- Carve out POST /api/stacks/webhooks/* in Caddyfile so Portainer webhooks can
  reach through the internal_only guard without exposing the full UI
- Update apply-compose.ps1 and sync-prod.ps1 paths from htpc-download-box to valhalla-lab
This commit is contained in:
ginnoir
2026-06-03 23:09:53 -05:00
parent 8558872362
commit bb46b1c10e
4 changed files with 21 additions and 30 deletions
+11
View File
@@ -185,9 +185,20 @@ dev.ginnoir.com {
# MANAGEMENT — internal only # MANAGEMENT — internal only
# ============================================================= # =============================================================
portainer.ginnoir.com { portainer.ginnoir.com {
@webhook {
method POST
path /api/stacks/webhooks/*
}
handle @webhook {
reverse_proxy portainer:9000
}
handle {
import internal_only import internal_only
reverse_proxy portainer:9000 reverse_proxy portainer:9000
} }
}
uptime.ginnoir.com { uptime.ginnoir.com {
import internal_only import internal_only
+3 -3
View File
@@ -2,7 +2,7 @@
# to the live Docker stack. # to the live Docker stack.
# #
# On valhalla, `dc` is aliased (in ~/.bashrc) to: # On valhalla, `dc` is aliased (in ~/.bashrc) to:
# docker-compose -f ~/htpc-download-box/docker-compose.yml --env-file ~/htpc-download-box/.env # docker compose -f ~/valhalla-lab/docker-compose.yml --env-file ~/valhalla-lab/.env
# It's a shell alias, so we invoke it over SSH with `bash -ic` to load it. # It's a shell alias, so we invoke it over SSH with `bash -ic` to load it.
# #
# Usage (flags combine; no flags = push & apply all three): # Usage (flags combine; no flags = push & apply all three):
@@ -33,7 +33,7 @@ if (-not $Compose -and -not $Caddy -and -not $EnvFile) {
if ($EnvFile) { if ($EnvFile) {
Write-Host "Pushing .env ..." Write-Host "Pushing .env ..."
scp $envLocal "${server}:~/htpc-download-box/.env" scp $envLocal "${server}:~/valhalla-lab/.env"
} }
if ($Caddy) { if ($Caddy) {
@@ -45,7 +45,7 @@ if ($Caddy) {
if ($Compose) { if ($Compose) {
Write-Host "Pushing docker-compose.yml ..." Write-Host "Pushing docker-compose.yml ..."
scp $composeLocal "${server}:~/htpc-download-box/docker-compose.yml" scp $composeLocal "${server}:~/valhalla-lab/docker-compose.yml"
Write-Host "Pulling latest images ..." Write-Host "Pulling latest images ..."
ssh $server "bash -ic 'dc pull'" ssh $server "bash -ic 'dc pull'"
Write-Host "Applying compose changes (recreates only changed containers) ..." Write-Host "Applying compose changes (recreates only changed containers) ..."
+3 -23
View File
@@ -76,6 +76,7 @@ services:
- famapp - famapp
- authentik - authentik
- management - management
- portainer_proxy
ports: ports:
- "80:80" - "80:80"
- "443:443" - "443:443"
@@ -566,18 +567,6 @@ services:
# ============================================================ # ============================================================
# MANAGEMENT # MANAGEMENT
# ============================================================ # ============================================================
portainer:
container_name: portainer
image: portainer/portainer-ce:latest
restart: unless-stopped
networks:
- management
ports:
- "9100:9000"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /config/portainer:/data
uptime-kuma: uptime-kuma:
container_name: uptime_kuma container_name: uptime_kuma
image: louislam/uptime-kuma:2 image: louislam/uptime-kuma:2
@@ -618,17 +607,6 @@ services:
ports: ports:
- "9009:80" - "9009:80"
watchtower:
container_name: watchtower
image: containrrr/watchtower:latest
restart: unless-stopped
environment:
- WATCHTOWER_NOTIFICATION_SKIP_TITLE=true
- WATCHTOWER_NOTIFICATION_URL=ntfy://ntfy.ginnoir.com/watchtower?title=WatchtowerUpdates
- DOCKER_API_VERSION=1.40
volumes:
- /var/run/docker.sock:/var/run/docker.sock
# ============================================================ # ============================================================
# FAMAPP # FAMAPP
# ============================================================ # ============================================================
@@ -801,6 +779,8 @@ networks:
famapp: famapp:
authentik: authentik:
management: management:
portainer_proxy:
external: true
volumes: volumes:
minio_data: minio_data:
+2 -2
View File
@@ -15,8 +15,8 @@ $repoDir = $PSScriptRoot
Write-Host "Syncing production configs from $server ..." Write-Host "Syncing production configs from $server ..."
scp "${server}:~/htpc-download-box/docker-compose.yml" "$repoDir\docker-compose.yml" scp "${server}:~/valhalla-lab/docker-compose.yml" "$repoDir\docker-compose.yml"
scp "${server}:~/htpc-download-box/.env" "$repoDir\.env" scp "${server}:~/valhalla-lab/.env" "$repoDir\.env"
scp "${server}:/config/caddy/Caddyfile" "$repoDir\Caddyfile" scp "${server}:/config/caddy/Caddyfile" "$repoDir\Caddyfile"
Write-Host "Done. Files synced:" Write-Host "Done. Files synced:"