Implemented full Docker containerization to support both local development and production deployments with Laravel Sail and custom production builds. Development Environment (Laravel Sail): - Installed Laravel Sail with PostgreSQL 17, Redis 7, and Mailpit - Custom Sail Dockerfile with PHP 8.4, Node.js 22, Chromium/Puppeteer - Complete development stack with hot module replacement support - Services accessible: Laravel (port 80), PostgreSQL (5432), Redis (6379), Mailpit (8025) Production Environment: - Multi-stage production Dockerfile for optimized image size - Separate node builder, composer builder, and runtime stages - PHP-FPM + Nginx for production-ready web server - Supervisor for queue workers and scheduled tasks - Production docker-compose.yml with health checks Infrastructure & Tooling: - Health check endpoint at /health (tests DB and Redis connectivity) - Automated deployment script (scripts/deploy.sh) - Makefile with common Docker commands - Environment templates (.env.example, .env.production.example) - Comprehensive documentation (DOCKER.md) Configuration Updates: - Updated .env.example with Docker service names (pgsql, redis, mailpit) - Added health check route to bootstrap/app.php - Removed deprecated docker-compose.dev.yml - Updated CLAUDE.md with PDF generation ARM limitation notes Maintenance & Cleanup: - Removed redundant migrations causing duplicate column errors - Added .dockerignore for optimized build context - Created Sail alias script for convenience Docker Architecture: - Development: Ubuntu 24.04, PHP 8.4, Node 22, PostgreSQL 17, Redis 7 - Production: Alpine-based multi-stage build with security hardening - Both environments use consistent service naming for easy switching Usage: - Development: ./vendor/bin/sail up -d && npm run dev - Production: ./scripts/deploy.sh or docker-compose -f docker-compose.production.yml up -d - Full documentation in DOCKER.md Known Limitations: - PDF generation (Puppeteer) doesn't work on ARM Macs in Docker - Documented workarounds in DOCKER.md and CLAUDE.md - Production x86_64 deployments work perfectly 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
86 lines
2.0 KiB
Plaintext
86 lines
2.0 KiB
Plaintext
# ==================== Production Environment Template ====================
|
|
# Copy this to .env on production server and update with actual values
|
|
|
|
APP_NAME="CannaBrands"
|
|
APP_ENV=production
|
|
APP_KEY=base64:GENERATE_WITH_php_artisan_key:generate
|
|
APP_DEBUG=false
|
|
APP_TIMEZONE=America/Los_Angeles
|
|
APP_URL=https://your-production-domain.com
|
|
|
|
APP_LOCALE=en
|
|
APP_FALLBACK_LOCALE=en
|
|
APP_FAKER_LOCALE=en_US
|
|
|
|
APP_MAINTENANCE_DRIVER=file
|
|
|
|
BCRYPT_ROUNDS=12
|
|
|
|
LOG_CHANNEL=stack
|
|
LOG_STACK=single
|
|
LOG_DEPRECATIONS_CHANNEL=null
|
|
LOG_LEVEL=info
|
|
|
|
# ==================== Database (Docker Service) ====================
|
|
DB_CONNECTION=pgsql
|
|
DB_HOST=postgres
|
|
DB_PORT=5432
|
|
DB_DATABASE=cannabrands_app
|
|
DB_USERNAME=sail
|
|
DB_PASSWORD=CHANGE_THIS_IN_PRODUCTION
|
|
|
|
# ==================== Session/Cache/Queue (Redis) ====================
|
|
SESSION_DRIVER=redis
|
|
SESSION_LIFETIME=120
|
|
SESSION_ENCRYPT=false
|
|
SESSION_PATH=/
|
|
SESSION_DOMAIN=null
|
|
|
|
BROADCAST_CONNECTION=redis
|
|
FILESYSTEM_DISK=local
|
|
QUEUE_CONNECTION=redis
|
|
|
|
CACHE_STORE=redis
|
|
CACHE_PREFIX=cannabrands_
|
|
|
|
# ==================== Redis (Docker Service) ====================
|
|
REDIS_CLIENT=phpredis
|
|
REDIS_HOST=redis
|
|
REDIS_PASSWORD=
|
|
REDIS_PORT=6379
|
|
|
|
# ==================== Mail (Mailpit or SMTP) ====================
|
|
MAIL_MAILER=smtp
|
|
MAIL_HOST=mailpit
|
|
MAIL_PORT=1025
|
|
MAIL_USERNAME=null
|
|
MAIL_PASSWORD=null
|
|
MAIL_ENCRYPTION=null
|
|
MAIL_FROM_ADDRESS="noreply@your-domain.com"
|
|
MAIL_FROM_NAME="${APP_NAME}"
|
|
|
|
# For production SMTP (comment out mailpit above):
|
|
# MAIL_MAILER=smtp
|
|
# MAIL_HOST=smtp.mailtrap.io
|
|
# MAIL_PORT=2525
|
|
# MAIL_USERNAME=your_username
|
|
# MAIL_PASSWORD=your_password
|
|
# MAIL_ENCRYPTION=tls
|
|
|
|
# ==================== AWS (if using S3 for file storage) ====================
|
|
AWS_ACCESS_KEY_ID=
|
|
AWS_SECRET_ACCESS_KEY=
|
|
AWS_DEFAULT_REGION=us-east-1
|
|
AWS_BUCKET=
|
|
AWS_USE_PATH_STYLE_ENDPOINT=false
|
|
|
|
# ==================== Vite ====================
|
|
VITE_APP_NAME="${APP_NAME}"
|
|
|
|
# ==================== Docker Ports ====================
|
|
APP_PORT=80
|
|
DB_PORT=5432
|
|
REDIS_PORT=6379
|
|
MAILPIT_SMTP_PORT=1025
|
|
MAILPIT_UI_PORT=8025
|