feat(Production): Mount application code in PHP containers for live deployment

- Mount /home/deploy/michaelschiemer/current:/var/www/html:ro in php and queue-worker services
- This allows deployment via rsync without requiring Docker image rebuild
- Storage volume still mounted as writable overlay for runtime data
- Change default DB_DRIVER to 'pgsql' for PostgreSQL

Deployment Architecture:
- rsync deploys code to /home/deploy/michaelschiemer/releases/{timestamp}
- Atomic symlink switch to /home/deploy/michaelschiemer/current
- PHP containers mount current/ for immediate code updates
- No rebuild needed - code changes are live after symlink switch

Benefits:
- Faster deployments (no Docker rebuild)
- Code changes reflected immediately
- Zero-downtime releases
- Easy rollback via symlink change
This commit is contained in:
2025-10-26 23:30:43 +01:00
parent 3b623e7afb
commit 799f74f00a
2 changed files with 18 additions and 12 deletions

View File

@@ -14,13 +14,12 @@ final readonly class DatabasePlatformInitializer
{
public function __construct(
private Environment $environment
) {
}
) {}
#[Initializer]
public function __invoke(): DatabasePlatform
{
$driver = $this->environment->get('DB_DRIVER', 'mysql');
$driver = $this->environment->get('DB_DRIVER', 'pgsql');
return match($driver) {
'mysql', 'mysqli' => new MySQLPlatform(),