Containerizing with Docker
To ensure consistent, reproducible deployments, I packaged the entire Laravel application inside a Docker container. The image includes:
- PHP and all required extensions
- Laravel application code and compiled assets (via npm run build)
- Configuration baked in per environment (staging vs. production)
I wrote a Python build script (build_docker_image.py) to automate the entire process: swapping environment files, backing up large storage folders (excluded from the image), building the image, saving it to a .tar archive, and reverting all changes cleanly — even on failure.
Staging First
Before touching production, I ran a full staging deployment. This caught several real issues:
- Email verification edge cases that only surfaced with real SMTP
- Environment-specific configuration gaps
- Asset path issues between local and container environments
Staging environments exist for exactly this reason. Shipping directly to production would have been a gamble — staging made it a controlled release.
Stripe Integration
An optional Stripe subscription was added for players who want to support the project and unlock bonus perks. This required careful handling of webhooks, subscription states, and graceful degradation for non-subscribers.
Production Launch: February 14
The virtual pet game went live. Players can now:
- Raise and evolve their own monsters
- Battle other trainers
- Explore locations and climb the leaderboard
- Shop, upgrade, and progress through story content
From a single idea to a live, interactive game in under two weeks.
