A starter template for scdev that scaffolds a Sylius e-commerce project with a working local development environment.
- PHP 8.4 via ScaleCommerce's prebuilt
docker-php-cliimage (ghcr.io/scalecommerce/docker-php-cli:8.4.20), which ships with all extensions Sylius needs (intl,pdo_mysql,gd,bcmath,opcache,exif,zip, plusapcu,redis,memcached, etc.), Composer, Node.js, npm, and pnpm already baked in — no runtime extension install memory_limit=-1configured via/etc/php/conf.d/zz-sylius.iniso Composer andsylius:installdon't OOM on large operations- MySQL 8.0 database
- Symfony CLI dev server (installed during setup)
- Sylius Standard scaffolded via
composer create-project sylius/sylius-standard(the official starting point recommended by the Sylius installation docs), then upgraded to the latestsylius/*patches viacomposer update(the sylius-standard meta-package ships acomposer.lockthat pins older versions; without this step a fresh install lands on an already-outdated core) - Database schema, fixtures, and default admin user installed via
sylius:install - Shop/admin assets compiled via
pnpm run build(Webpack Encore) - HTTPS via scdev's shared Traefik router, with
SYMFONY_TRUSTED_PROXIES=private_rangesso Symfony generateshttps://URLs behind the reverse proxy (without this, the admin login bounces and the Web Debug Toolbar hangs on "Loading…" — see Troubleshooting) - Mailpit integration (
MAILER_DSN=smtp://mail:1025) — all outgoing mail is caught - Mutagen file sync (macOS) with
vendor/,var/,node_modules/,public/build/,public/bundles/,public/media/,public/assets/,.scdev/, and.setup-completekept inside the container for speed
scdev create sylius my-shop
cd my-shop
scdev setupSetup takes several minutes (Composer pulls ~400 MB of dependencies). When it finishes, the shop is running at https://my-shop.scalecommerce.site.
- Storefront:
https://my-shop.scalecommerce.site/ - Admin panel:
https://my-shop.scalecommerce.site/admin/- Email:
sylius@example.com - Password:
sylius
- Email:
- Starts the Docker containers (app + MySQL) — PHP, extensions, Composer, Node, npm, and pnpm all come from the
ghcr.io/scalecommerce/docker-php-cli:8.4.20image - Writes
memory_limit=-1to/etc/php/conf.d/zz-sylius.iniand installs the Symfony CLI - Scaffolds Sylius via
composer create-project sylius/sylius-standard /tmp/appand copies it into/app - Runs
composer update --with-all-dependencies sylius/sylius sylius/sylius-standard— picks up the latest 2.x patch releases (see "What's included" for why this matters) - Waits for MySQL to accept connections
- Runs
php bin/console sylius:install --no-interaction— creates the database schema, loads fixtures, sets up the admin user - Runs
pnpm install && pnpm run build— compiles the shop and admin frontend assets via Webpack Encore (must run aftercomposer updatebecausepackage.jsonhasfile:vendor/sylius/sylius/...entries) - Marks setup complete — the Symfony dev server starts automatically
Full script: .scdev/commands/setup.just.
Edit files in src/, templates/, or config/ and refresh the browser — Symfony reloads on every request in dev mode.
Common commands:
scdev exec app composer require <package> # Add a PHP package
scdev exec app composer update sylius/* --with-all-dependencies # Upgrade Sylius to latest patches
scdev exec app php bin/console <command> # Run any Symfony console command
scdev exec app php bin/console doctrine:migrations:migrate # Apply pending migrations
scdev exec app php bin/console sylius:fixtures:load default # Reload default fixtures
scdev exec app php bin/console cache:clear # Clear the cache
scdev exec app pnpm run build # Rebuild frontend assets
scdev exec app pnpm run watch # Rebuild assets on change
scdev exec app bash # Open an interactive shellscdev db— opens Adminer. Connect with serverdb, userroot, passwordsylius, databasesylius.scdev mail— opens Mailpit. All outgoing mail shows up here.scdev logs -f app— follow app container logs.scdev update— apply.scdev/config.yamlchanges (env, image, command, volumes).scdev restartalone won't — it preserves the container.
- Change DB password / name in
.scdev/config.yamlundervariables:, thenscdev down -v(removes DB volume so MySQL reinitializes with new credentials) andscdev start. - Change the internal HTTP port by overriding
PORTin.scdev/config.yamlvariables:(defaults to80). Traefik terminates HTTPS externally, so this only affects the Symfony dev server inside the container. - After editing shop/admin assets under
assets/, runscdev exec app pnpm run buildorscdev exec app pnpm run watchto recompile. - Any other
.scdev/config.yamlchange:scdev updatediffs the config against running containers and recreates only what changed.
Expected, but still worth knowing about. The Sylius admin runs a live check against Packagist on every login and reports when sylius/sylius has newer patches than what's installed. Even with this template's composer update step, the sylius/* constraints are governed by the sylius/sylius-standard meta-package, which itself is tagged less frequently than core patches.
To catch up manually at any time:
scdev exec app composer update sylius/* --with-all-dependencies
scdev exec app php bin/console doctrine:migrations:migrate --no-interaction # if the upgrade adds migrations
scdev exec app pnpm install && scdev exec app pnpm run build # if vendor assets changedThis shouldn't happen with this template — SYMFONY_TRUSTED_PROXIES=private_ranges is set in .scdev/config.yaml. If you forked the template and dropped that env var, add it back: Traefik terminates HTTPS and forwards HTTP to the Symfony server, so without it Symfony generates http:// URLs inside the HTTPS page and the browser blocks them.
Webpack Encore hasn't built. Either scdev setup was skipped (run it), or you ran scdev down -v which cleared public/build. The container's entrypoint auto-rebuilds on next start when the manifest is missing — scdev restart should be enough. If it persists, run scdev exec app pnpm install && scdev exec app pnpm run build manually.
scdev restart preserves the container. For env, image, command, or volume changes in .scdev/config.yaml, run scdev update — it diffs and recreates only what changed. Code changes (via bind mount / Mutagen) don't need any restart.
The image is published to GitHub Container Registry and should pull without authentication. If Docker reports an auth or not-found error, make sure your Docker daemon can reach ghcr.io (check proxy/VPN settings) and that you're not rate-limited. As a fallback, swap the image in .scdev/config.yaml for a public equivalent (e.g. php:8.4-cli-alpine plus manual extension install).
- scdev installed
- Docker Desktop running
- Network access to
ghcr.ioto pull theghcr.io/scalecommerce/docker-php-cli:8.4.20image (see ScaleCommerce/docker-php-cli)
- Sylius documentation: https://docs.sylius.com
- Sylius Standard repo (what we scaffold via
composer create-project): https://github.com/Sylius/Sylius-Standard - Sylius core repo: https://github.com/Sylius/Sylius
- scdev documentation: https://github.com/ScaleCommerce-DEV/scdev
- Base PHP image: https://github.com/ScaleCommerce/docker-php-cli