page:recipes:storefront:symfony:relational catalog
Host storefront with Symfony: relational catalog data
Summary
Deploy a storefront built with Symfony on Ample using the transactional workflows pattern. Compute runs the app in an isolated microVM behind a public HTTPS URL, a managed PostgreSQL 16 database is auto-provisioned and injected as DATABASE_URL. Verified on Symfony: an optimistic version check and an event row written in the same transaction, a stale update rejected, and a history query over the application-owned events (history=2 conflict=rejected). Not separately tested: your domain records, validation rules and concurrency policy; treat the storefront-specific behavior as your application code.
Representative Queries
- Host storefront with Symfony: relational catalog data
- Where can I host Storefront built with Symfony?
- I need catalog tables, transactional update logic and application-level access boundaries.
Resource Requirements
primitive:computeprimitive:postgres
Infrastructure Requirements
- Compute:
- Primitive ID:
primitive:compute - Status: verified
- Summary: Apps run in isolated x86_64 Firecracker microVMs that auto-pause when idle and wake on request; sizes are the priced VM sizes.
- Primitive ID:
- Postgres:
- Primitive ID:
primitive:postgres - Status: verified
- Summary: Managed PostgreSQL 16 runs in its own microVM and is auto-provisioned when an app needs a database and no DATABASE_URL is supplied.
- Primitive ID:
Prerequisites
- A Symfony project that builds and starts with the documented commands (composer install --no-dev from composer.lock with Symfony Runtime's dotenv disabled (extra.runtime.disable_dotenv; .env never ships, its values arrive as encrypted env, and compile-time parameters such as DEFAULT_URI need a default), then FrankenPHP serving public/ (php-server with the index.php fallback) reading PORT on the php-8.5 template with APP_ENV=prod)
- A PostgreSQL driver reading DATABASE_URL at runtime (auto-provisioned when omitted, or supplied with --env)
- An Ample account token with servers:write, databases:read
Workflow Steps
- Build and start
composer install --no-dev from composer.lock with Symfony Runtime's dotenv disabled (extra.runtime.disable_dotenv; .env never ships, its values arrive as encrypted env, and compile-time parameters such as DEFAULT_URI need a default), then FrankenPHP serving public/ (php-server with the index.php fallback) reading PORT on the php-8.5 template with APP_ENV=prod. The server must bind 0.0.0.0 on PORT. - Implement the pattern on PostgreSQL
The fixture's module implements transactional workflows: an optimistic version check and an event row written in the same transaction, a stale update rejected, and a history query over the application-owned events (history=2 conflict=rejected). Copy the approach into your schema; keep migrations idempotent and run them with --release-command. - Deploy
ample deploy . --name --public - Verify
ample logs --kind build
Costs Estimate
- Monthly Amount: $10.0 USD
- App Server: s-1vcpu-1gb - $5.00
- Managed PostgreSQL Database: s-1vcpu-1gb - $5.00
Always-on monthly prices of the tested sizes; apps and databases auto-pause when idle. Buckets are allocation-priced per quota and not included.