my-homelab-configs/apps/website
juvdiaz d4c823b3a2 Add dedicated website translation model 2026-06-10 10:34:00 -06:00
..
images migration: incorporate repository secrets and apply clean application definitions 2026-05-19 08:06:40 -05:00
lang Start image validation in audit mode 2026-06-04 17:50:07 -06:00
ollama Add dedicated website translation model 2026-06-10 10:34:00 -06:00
partials Updating translation endpoint so its reachable 2026-05-29 12:05:30 -06:00
Dockerfile Add dedicated website translation model 2026-06-10 10:34:00 -06:00
README.md Document website performance tuning 2026-06-04 11:32:38 -06:00
blog.php Add signed SBOM enforcement for local images 2026-06-04 12:12:42 -06:00
buildkitd.toml redesign 2026-05-23 21:00:28 -06:00
cv-theme.js Fixing theme button 2026-05-29 11:12:20 -06:00
cv.php Fixing theme button 2026-05-29 11:12:20 -06:00
demos.php Refocus portfolio for DevOps MLOps roles 2026-05-28 20:14:42 -06:00
gnu.webp migration: incorporate repository secrets and apply clean application definitions 2026-05-19 08:06:40 -05:00
homelab-tree.php Bootstrap external Gitea 2026-05-27 14:15:10 -05:00
httpd-php-fpm.conf Add cache headers for website static output 2026-06-04 10:59:23 -06:00
ideas_helper.php Collect visitor homelab ideas safely 2026-05-25 21:12:51 -06:00
index.php Fixing theme button 2026-05-29 11:12:20 -06:00
kustomization.yaml Adding local tags to images and enforcing them at pods 2026-05-29 12:23:44 -06:00
lang_helper.php Add homelab provisioning automation 2026-05-26 11:46:38 -06:00
namespace.yaml feat: add explicit website-production namespace manifest 2026-05-19 08:46:33 -05:00
opcache.ini Run website with Apache PHP-FPM and OPcache 2026-06-04 09:50:23 -06:00
php-fpm-runtime.conf Run website with Apache PHP-FPM and OPcache 2026-06-04 09:50:23 -06:00
render-static-pages.sh Pre-render website read pages 2026-06-04 10:42:21 -06:00
save_idea.php Collect visitor homelab ideas safely 2026-05-25 21:12:51 -06:00
save_lang.php Add homelab provisioning automation 2026-05-26 11:46:38 -06:00
start-website.sh Run website with Apache PHP-FPM and OPcache 2026-06-04 09:50:23 -06:00
styles.css Fixing theme button 2026-05-29 11:12:20 -06:00
translate.php Cache website translations in Redis 2026-06-10 10:31:16 -06:00
translation.js Updating translation endpoint so its reachable 2026-05-29 12:05:30 -06:00
visitor-ideas.js Pre-render website read pages 2026-06-04 10:42:21 -06:00
visitor_ideas.php Pre-render website read pages 2026-06-04 10:42:21 -06:00
web-app.yaml Add dedicated website translation model 2026-06-10 10:34:00 -06:00

README.md

Website Runtime

The portfolio website keeps Apache at the core while moving PHP execution to PHP-FPM.

Runtime Shape

  • Base image: php:8.5-fpm-alpine
  • Web server: Alpine Apache, listening on container port 8080
  • PHP runtime: PHP-FPM on 127.0.0.1:9000
  • PHP cache: OPcache enabled, with timestamp validation disabled for immutable image deploys
  • Dynamic storage: /var/www/localhost/htdocs/db mounted from the retained website-db PVC

Apache routes *.php through proxy_fcgi to PHP-FPM. The startup script starts PHP-FPM in the background and then runs Apache in the foreground.

Static Render Path

render-static-pages.sh runs during the image build and renders static HTML for the read-heavy pages:

  • /
  • /cv.php
  • /blog.php
  • /demos.php
  • /homelab-tree.php

Static output is generated for the committed static languages under /static-pages/<lang>/. Apache rewrites supported static-language requests to those generated HTML files. Requests for runtime-generated languages still fall through to PHP so the translation workflow continues to work.

blog.php no longer renders visitor ideas directly into the HTML. Recent ideas are served by visitor_ideas.php and loaded by visitor-ideas.js, which keeps the blog page cacheable while preserving the write path through save_idea.php.

Cache Path

The website sets cache headers for pre-rendered HTML:

Cache-Control: public, max-age=300, s-maxage=3600

Dynamic write and translation endpoints are marked no-store:

  • save_idea.php
  • visitor_ideas.php
  • translate.php
  • save_lang.php

The OCI edge nginx layer handles gzip, cache HITs, HTTP/2, TLS session reuse, client keepalive, and upstream keepalive to the Traefik backend. CSS and JavaScript keep the edge's longer immutable asset policy.

Validation

Do not build images locally. The image is built and deployed by the Debian homelab path and Gitea Actions.

Local source validation that does not build the image:

shellcheck apps/website/start-website.sh apps/website/render-static-pages.sh
find apps/website -name "*.php" -print0 | xargs -0 -n1 php -l
node --check apps/website/visitor-ideas.js
kubectl kustomize apps/website >/tmp/website-kustomize.yaml

Static rendering can be checked without Docker by copying the app to a temporary directory and running:

sh render-static-pages.sh /path/to/copied/apps/website