Deploy TukuToi Astro website and PHP forms

This commit is contained in:
smileBeda committed 2026-10-29 13:45:50 +00:00
commit 554b14e435
3 files changed
+80

No files matched your search

+3
View File
@@ -0,0 +1,3 @@
.env
.env.*
*.log
+39
View File
@@ -0,0 +1,39 @@
# TukuToi
Astro website served by nginx, with PHP-FPM contact and review forms delivered through Postmark.
## Deployment layout
- **Compose:** `/srv/docker/tukutoi/docker-compose.yml`
- **Static configuration/source:** this directory holds deployment configuration only; private application source, Dockerfile, and nginx/PHP configuration come from `ssh://git@git.yoonect.com:2222/TukuToi/TukuToi-LLC-Website.git`, branch `main`, with Dockerfile targets `web` and `php`
- **Non-secret environment:** application defaults are in private source; no project-local environment file is required
- **Secrets:** `/srv/docker/secrets/tukutoi/forms.env`; private Git builds use the operator's forwarded SSH agent
- **NVMe application state:** none declared
- **Bulk HDD data:** none used by the new application
- **Other mounts:** none
Secrets are never committed to this repository. The central secret environment is supplied only to the `php` service. Required settings are `FORM_SECRET`, `POSTMARK_TOKEN`, `MAIL_FROM`, and `MAIL_TO`; optional settings include `PUBLIC_EMAIL`, `SITE_URL`, `POSTMARK_STREAM`, and the four `TEMPLATE_*` aliases documented in application source. SSH credentials are available to the builder, not mounted into runtime containers.
## Dependencies and recovery
- **Networks/dependencies:** web and PHP share the default project bridge; web also joins external `npm_proxy` at `192.168.99.18`, serving HTTP port 80 without host-published ports. PHP needs outbound Postmark access. Building requires authenticated Git access, base-image and npm downloads; optional ECB rates retrieval falls back to committed data. The four Postmark templates must exist.
- **Back up:** deployment configuration, private application repository, central form environment, and external Postmark template configuration. The legacy WordPress backup was transferred to the owner’s Mac as `tukutoi-backup-WwP4kF8R`, with all seven manifest checksums verified. Preserve that Mac copy for later restoration. The redundant `/data/Data1/tukutoi-backup-WwP4kF8R` copy was deleted, with exact-path absence verified on 2026-10-29; the backup is independent of new-site runtime storage.
- **Re-creatable:** both images and containers; APCu rate-limit state is transient. Build both targets from deployable `main`, record its resolved commit and resulting image IDs for each release, then recreate containers. Retain previous images for rollback; rebuilding moving `main` does not reproduce a previous release. Validate pages, redirects, and both forms, including all expected Postmark emails.
Deployment and application acceptance were owner-confirmed on 2026-10-29. The private application README remains separate and unchanged by the host deployment documentation. The old WordPress files and temporary source checkout are retirement items, not dependencies of the new application.
## Building on Nautilus
The successful build used host networking for build steps and SSH-agent forwarding. Runtime containers retain their bridge networks. The private Dockerfile's Node build stage sets `NODE_OPTIONS="--dns-result-order=ipv4first --no-network-family-autoselection"` before `npm ci`. Owner testing showed the default Node connection failed while forced IPv4 and npm with these options downloaded the same package successfully. Host networking alone did not resolve the failure; its independent necessity has not been established.
With the operator's SSH agent loaded, run:
```bash
cd /srv/docker/tukutoi
sudo env SSH_AUTH_SOCK="$SSH_AUTH_SOCK" docker buildx bake \
-f docker-compose.yml --allow=network.host --allow=ssh \
--set web.tags=tukutoi-web --set php.tags=tukutoi-php \
--pull --load web php
```
The remote `main` must contain source changes before rebuilding. The temporary local review checkout is not the build context. Never publish build authentication or runtime secrets with this deployment repository.
+38
View File
@@ -0,0 +1,38 @@
name: tukutoi
services:
web:
build:
context: ssh://git@git.yoonect.com:2222/TukuToi/TukuToi-LLC-Website.git#main
target: web
network: host
entitlements:
- network.host
ssh:
- default
restart: unless-stopped
depends_on:
- php
networks:
default:
npm_proxy:
ipv4_address: 192.168.99.18
php:
build:
context: ssh://git@git.yoonect.com:2222/TukuToi/TukuToi-LLC-Website.git#main
target: php
network: host
entitlements:
- network.host
ssh:
- default
env_file:
- /srv/docker/secrets/tukutoi/forms.env
restart: unless-stopped
networks:
- default
networks:
npm_proxy:
external: true