Step 13 — Deploy
php pionia serve is for learning. Real customers need a process that stays up, uses production secrets, and runs your migrations on a real database.
What does “deploy” mean? (in general)
Deploy = put your app on a machine (or container) the public can reach, with:
- Code installed (
composer install --no-dev) - Config for that environment (
.envwith realJWT_SECRET, DB password) - Schema applied (
migrate) - A long-running HTTP server (PHP-FPM behind Nginx, or RoadRunner workers)
Local serve starts a tiny built-in server and exits when you close the terminal. Production uses a worker or FPM pool that handles many requests.
RoadRunner is optional but nice for Pionia: boot PHP once, handle many HTTP requests in a loop (faster than starting PHP from scratch each time).
What you will learn
- A minimal production checklist for Pionia Shop
- Where to put secrets
- How to smoke-test with ping
- Shop API works locally through at least Step 9
Minimal checklist
composer install --no-dev -o
php pionia migrate
php pionia optimize --production
php pionia runserver --detach
curl -s http://127.0.0.1:8000/api/v1/pingPut real JWT_SECRET and database credentials in the server .env — never in git.
If you built a frontend (Step 12), run frontend:build on the server (or in CI) so public/ has the storefront assets.
Guides: RoadRunner and Production performance.
Common mistakes
- Shipping with
DEBUG=trueand a toy JWT secret - Forgetting
migrateon the new host — empty database, confusing 500s - Pointing DNS at the machine but never opening the firewall / reverse proxy to the app port