Files
Keith Solomon d3e8cf8fae build: M1 Dockerized development stack with PHP skeleton, config/logging, Tailwind assets, and wrappers
Implements MeshVault M1 (issues #6–11):

- Four-service Docker Compose stack (nginx, PHP-FPM 8.3, PostgreSQL 17, Node assets)
- Slim 4 + PHP-DI routing with escaped PHP views and production/dev error handling
- Immutable validated AppConfig with redacted diagnostics
- JSON stdout Monolog logging with job-scoped context
- Tailwind CSS v4 deterministic locked builds with template scanning
- POSIX and PowerShell dev wrappers (up/down/test/lint/assets/watch)
- Startup config validation fails before FPM serves as unprivileged www-data
- migrate/seed explicitly unavailable until M2 (#12); #10 remains open

Verified via clean-start acceptance on remote host (keith@192.168.2.23).
2026-10-11 16:45:45 -05:00

33 lines
1.3 KiB
PHP

<?php
declare(strict_types=1);
// This boundary intentionally does not depend on autoloading, DI or templates.
ini_set('display_errors', '0');
$stage = 'autoload';
try {
require dirname(__DIR__) . '/vendor/autoload.php';
$stage = 'configuration';
$config = \MeshVault\Config\AppConfig::fromEnvironment(getenv());
$stage = 'application';
\MeshVault\Http\AppFactory::create($config)->run();
} catch (\Throwable $exception) {
$safeDetail = $stage === 'configuration' && $exception instanceof \InvalidArgumentException
? $exception->getMessage()
: 'Check dependencies and application bootstrap at ' . $exception->getFile() . ':' . $exception->getLine();
error_log((string) json_encode([
'message' => 'Application bootstrap failed',
'stage' => $stage,
'detail' => $safeDetail,
'exception_type' => $exception::class,
], JSON_UNESCAPED_SLASHES | JSON_INVALID_UTF8_SUBSTITUTE));
http_response_code(500);
header('Content-Type: text/html; charset=utf-8');
echo '<!doctype html><html lang="en"><meta charset="utf-8"><title>Internal Server Error</title>';
echo '<h1>Internal Server Error</h1>';
if (getenv('MESHVAULT_ENV') === 'development') {
echo '<pre>' . htmlspecialchars($safeDetail, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8') . '</pre>';
}
echo '</html>';
}