Deployment
Docker Build
The Portal is containerized using a Dockerfile based on PHP 8.3-FPM with Nginx. The image is built from a custom base image hosted in AWS ECR.
Build Process
The Dockerfile at the project root performs these steps:
- Installs PHP extensions:
pdo_mysql,gd,zip,intl,bcmath,opcache - Installs Node.js 18 (for Vite build)
- Installs Supervisor (process manager) and Nginx
- Runs
composer install - Runs
npm install && npm run build(Vite production build) - Configures Nginx, PHP-FPM, and Supervisor
- Sets permissions for
www-data - Exposes port 80
Container Runtime
The container uses Supervisor to manage multiple processes:
- PHP-FPM — Handles PHP requests
- Nginx — Reverse proxy / web server
Configuration files in the deploy/ directory:
deploy.conf— Nginx site configurationnginx.conf— Nginx main configurationwww.conf— PHP-FPM pool configurationsupervisord.conf— Supervisor process definitionsopcache.ini— OPcache settings (timestamps validation disabled in production)run— Container entrypoint script
Key Build Optimizations
- OPcache
validate_timestampsis set to0(no file stat on every request) - Composer autoloader is optimized (
optimize-autoloader: true) - Vite build outputs to
assets/with fixed filenames (no content hashing)
Vite Production Build
npm run buildOutputs are written to public/build/ with these entry points:
assets/app.js— Main JavaScriptassets/app.css— Compiled SCSS + CSSassets/add-house-page.js/assets/add-house-page.cssassets/landlord-modal.js- Legacy asset JS files
Static assets (images, email templates, plugins) are copied from resources/assets/ to public/build/assets/.
Chunk size warning limit is set to 1600 KB.
Environment Configuration
Required Environment Variables
See setup.md for the full list. At minimum, production requires:
APP_ENV=production
APP_DEBUG=false
APP_URL=https://portal.housr.com # or appropriate domain
APP_KEY= # Laravel app key
DB_HOST= # MySQL host
DB_DATABASE=housr
DB_USERNAME=
DB_PASSWORD=
USA=false # or true for US deployment
# AWS S3 (for file storage)
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-2
# Firebase
FIREBASE_DATABASE_URL=
FIREBASE_CREDENTIALS=
# Sentry
SENTRY_LARAVEL_DSN=Post-Deploy Commands
After deploying new code:
php artisan config:cache # Cache configuration
php artisan route:cache # Cache routes
php artisan view:cache # Cache Blade templates
php artisan filament:upgrade # Rebuild Filament assetsAWS Infrastructure
S3 Buckets
Three S3 disks are configured in config/filesystems.php:
| Disk Name | Bucket | Purpose |
|---|---|---|
s3 | AWS_BUCKET | General file storage |
public_images | housr-public-images | Public images (house photos, agent logos, event banners) |
agent_documents | housr-agent-documents | Agent document uploads |
public_misc | housr-public-misc | Miscellaneous public files (CSV exports, etc.) |
All public buckets use public-read ACL.
ECR
The Docker base image is pulled from:
056644654815.dkr.ecr.us-east-2.amazonaws.com/php:8.3-fpmMonitoring
- Sentry (
sentry/sentry-laravel) for error tracking and performance monitoring - Laravel logs at
storage/logs/laravel.log - Slack notifications via
SlackBotServicefor specific operational events
Regional Deployments
The same codebase is deployed for both UK and US regions. The USA environment variable controls:
- Which features are visible (e.g., ratings, promotions are US-only)
- Payment processor used (Stripe for UK, Finix for US)
- Role display names (Landlord vs Property Owner)
- Currency (GBP vs USD)
- API endpoint URLs