3.7 KiB
AGENTS.md
This file provides guidance to AI coding agents (e.g. opencode, DeepSeek-based agents) when working with code in this repository.
What this is
CORXN is a Docker image definition (not an application) — a single Dockerfile built FROM php:8.5.8-fpm-trixie (official PHP image, Debian Trixie base) with Apache + Redis extension layered on top, intended as the base runtime for the Novaconium PHP Framework. There is no application code here; the repo's output is the built Docker image 4lights/corxn.
Key files
Dockerfile— builds the image: installs Apache viaapt, builds PHP extensions (mysqli,pdo_mysql,mbstring,zipviadocker-php-ext-install;redisviapecl) against the base image's pinned PHP 8.5.8 (xmlandcurlare already built into the base image, so they aren't reinstalled), enablesmpm_event+ PHP-FPM viaproxy_fcgi, sets security headers, compression, keepalive, and MPM tuning, and configures logrotate. PHP custom config is loaded from/php, layered in front of the base image's defaultconf.dviaPHP_INI_SCAN_DIR.000-default.conf— Apache vhost, copied into the image.DocumentRootis/data/public; PHP requests are proxied to the PHP-FPM unix socket at/run/php/php-fpm.sock. Logs go to stdout/stderr (/proc/self/fd/1and2) for Docker-friendly logging.php.ini— custom PHP settings copied into the image at/php/php.ini(uploads, timezoneAmerica/Vancouver, OPcache tuned for production withvalidate_timestamps=0, sessions backed by Redis attcp://redis:6379). Can be overridden at runtime by bind-mounting a different file to the same path.start.sh— container entrypoint: startsphp-fpm(daemonized) then runsapachectlin the foreground.docker-compose.yml— sample compose stack showing the intended usage:corxncontainer +redis+mariadb, with./test(or an app checkout) mounted to/dataso the app'spublic/dir is served.test/public— a minimal PHP app used to sanity-check the built image (see Testing below).
Building and testing
Build the image:
docker buildx build --no-cache -t 4lights/corxn:latest --load .
To bump the PHP version, change the base image tag in the FROM line (e.g. php:8.5.9-fpm-trixie) — the official image is versioned exactly, no separate pin mechanism needed.
Test the build:
mkdir -p data/uploads && sudo chown -R 33:33 data/uploads && chmod 775 data/uploads
docker compose up -d
# Visit: http://localhost:8000/test.php
# Verify: file upload works and green checkmarks appear
(UID 33 is www-data inside the container.)
View logs: docker logs corxn
Publishing (requires explicit user confirmation before pushing)
sudo su
docker buildx build --no-cache -t 4lights/corxn:8.5.8 -t 4lights/corxn:latest --load .
docker login -u <username>
docker push 4lights/corxn:8.5.8
docker push 4lights/corxn:latest
Architecture notes for changes
- Any consuming app is expected to be mounted at
/data, with its web-servable code under/data/public(matchesDocumentRootin000-default.conf). - PHP config changes belong in
php.ini(image default) — downstream users override it by bind-mounting their own file over/php/php.ini, so avoid assuming values inphp.iniare final. - Because
opcache.validate_timestamps=0, PHP file changes require a container restart/FPM reload to take effect — relevant when iterating ontest/publicduring image testing. - Sessions and app-level caching are expected to go through the
redisservice (session handler already wired totcp://redis:6379); MariaDB is the expected DB backend (seedocker-compose.ymlenv vars).