Skip to Content
Housr PortalDeployment

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:

  1. Installs PHP extensions: pdo_mysql, gd, zip, intl, bcmath, opcache
  2. Installs Node.js 18 (for Vite build)
  3. Installs Supervisor (process manager) and Nginx
  4. Runs composer install
  5. Runs npm install && npm run build (Vite production build)
  6. Configures Nginx, PHP-FPM, and Supervisor
  7. Sets permissions for www-data
  8. 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 configuration
  • nginx.conf — Nginx main configuration
  • www.conf — PHP-FPM pool configuration
  • supervisord.conf — Supervisor process definitions
  • opcache.ini — OPcache settings (timestamps validation disabled in production)
  • run — Container entrypoint script

Key Build Optimizations

  • OPcache validate_timestamps is set to 0 (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 build

Outputs are written to public/build/ with these entry points:

  • assets/app.js — Main JavaScript
  • assets/app.css — Compiled SCSS + CSS
  • assets/add-house-page.js / assets/add-house-page.css
  • assets/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 assets

AWS Infrastructure

S3 Buckets

Three S3 disks are configured in config/filesystems.php:

Disk NameBucketPurpose
s3AWS_BUCKETGeneral file storage
public_imageshousr-public-imagesPublic images (house photos, agent logos, event banners)
agent_documentshousr-agent-documentsAgent document uploads
public_mischousr-public-miscMiscellaneous 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-fpm

Monitoring

  • Sentry (sentry/sentry-laravel) for error tracking and performance monitoring
  • Laravel logs at storage/logs/laravel.log
  • Slack notifications via SlackBotService for 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
Last updated on