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:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user