diff --git a/README.md b/README.md index 800623b..ae83429 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Astro website with PHP-FPM forms, Postmark email delivery, and spam screening th ## Deployment layout - **Compose:** `/srv/docker/tukutoi/docker-compose.yml` -- **Static configuration/source:** deployment configuration under `/srv/docker/tukutoi`; private application source, Dockerfile, and nginx/PHP configuration from `ssh://git@git.yoonect.com:2222/TukuToi/TukuToi-LLC-Website.git`, branch `main`, build targets `web` and `php` +- **Static configuration/source:** deployment configuration under `/srv/docker/tukutoi`; private application source, Dockerfile, and nginx/PHP configuration from `ssh://git@10.7.0.1:2222/TukuToi/TukuToi-LLC-Website.git`, branch `main`, build targets `web` and `php` - **Non-secret environment:** Compose declares `OLLAMA_URL=http://192.168.1.4:11434`, `OLLAMA_MODEL=qwen3.5:4b`, and `OLLAMA_TIMEOUT=20`; other application defaults are declared in source - **Secrets:** `/srv/docker/secrets/tukutoi/forms.env`; builds authenticate through the operator's SSH agent - **NVMe application state:** `/srv/appdata/tukutoi/spam-lists`, mounted at `/var/lib/tukutoi` read-write by the `lists` updater and read-only by PHP; owned by the PHP image's numeric `www-data` identity, directory mode `0700` @@ -18,4 +18,19 @@ Secrets are never committed to this repository. The central secret environment i - **Networks/dependencies:** default project bridge between web, PHP, and lists; web joins external `npm_proxy` at `192.168.99.18`, HTTP port 80, without host-published ports. PHP requires Postmark with four configured templates and the Mac's Ollama endpoint with model `qwen3.5:4b`; lists requires StopForumSpam downloads. Missing lists disable list checks; unavailable Ollama leaves messages model-unchecked. Builds require private Git access, base-image/npm downloads, host build networking, and SSH-agent forwarding. The Node build stage uses `--dns-result-order=ipv4first --no-network-family-autoselection`. - **Back up:** deployment repository, private application repository, protected `forms.env`, and Postmark template configuration -- **Re-creatable:** two images and three containers, generated website, transient APCu state, and downloaded spam-list SQLite data; initialize lists before serving updated forms. The updater shares `tukutoi-php:latest`, runs as `www-data`, and refreshes daily with six-hour retry after failed updates. Rebuild web/PHP targets from `main` with Bake permissions `--allow=network.host --allow=ssh`, retaining release image IDs/source revisions for rollback +- **Re-creatable:** two images and three containers, generated website, transient APCu state, and downloaded spam-list SQLite data; initialize lists before serving updated forms. The updater shares `tukutoi-php:latest`, runs as `www-data`, and refreshes daily with six-hour retry after failed updates. Retain release image IDs and source revisions for rollback + +## Update after an application change on main + +Both build contexts point directly at the Gitea SSH listener on WireGuard (`10.7.0.1:2222`). The operator’s SSH hostname mapping applies to host Git commands. BuildKit fetches the remote context itself, before running the Dockerfile. Keep `build.network: host` and the source Dockerfile’s Node options for the npm build. + +From a shell with the private repository key loaded in your SSH agent, run: + +```bash +cd /srv/docker/tukutoi && +sudo --preserve-env=SSH_AUTH_SOCK docker compose up -d --build +``` + +Compose builds web and PHP from the private repository's current `main` and recreates services whose images changed, including `lists` when the PHP image changes. Preserving `SSH_AUTH_SOCK` lets the build use your agent under sudo. A pull in this directory only updates the deployment configuration. + +Check `sudo docker compose ps --all` and open the changed page. For a forms release, submit a test message and confirm the expected email arrives. diff --git a/docker-compose.yml b/docker-compose.yml index f896270..4b19421 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,7 @@ name: tukutoi services: web: build: - context: ssh://git@git.yoonect.com:2222/TukuToi/TukuToi-LLC-Website.git#main + context: ssh://git@10.7.0.1:2222/TukuToi/TukuToi-LLC-Website.git#main target: web network: host entitlements: @@ -22,7 +22,7 @@ services: image: tukutoi-php:latest pull_policy: never build: - context: ssh://git@git.yoonect.com:2222/TukuToi/TukuToi-LLC-Website.git#main + context: ssh://git@10.7.0.1:2222/TukuToi/TukuToi-LLC-Website.git#main target: php network: host entitlements: