A Docker-based installer and runtime for the Symfony web framework, with FrankenPHP and Caddy inside!
- If not already done, install Docker Compose (v2.10+)
- Run
docker compose build --no-cache
to build fresh images - Run
docker compose up --pull -d --wait
to start the project - Open
https://localhost
in your favorite web browser and accept the auto-generated TLS certificate - Run
docker compose down --remove-orphans
to stop the Docker containers.
- Production, development and CI ready
- Just 1 service by default
- Blazing-fast performance thanks to the worker mode of FrankenPHP (automatically enabled in prod mode)
- Installation of extra Docker Compose services with Symfony Flex
- Automatic HTTPS (in dev and prod)
- HTTP/3 and Early Hints support
- Real-time messaging thanks to a built-in Mercure hub
- Vulcain support
- Native XDebug integration
- Super-readable configuration
Enjoy!
- Build options
- Using Symfony Docker with an existing project
- Support for extra services
- Deploying in production
- Debugging with Xdebug
- TLS Certificates
- Using a Makefile
- Troubleshooting
Symfony Docker is available under the MIT License.
Created by Kévin Dunglas, co-maintained by Maxime Helias and sponsored by Les-Tilleuls.coop.
- Add templates Twig pack
composer require templates
- Add symfony asset
composer require symfony/asset
- Add symfony profiler
composer require --dev symfony/profiler-pack
- Add symfony maker
composer require --dev symfony/maker-bundle
- Add Doctrine
composer require symfony/orm-pack
- Add Form
composer require symfony/form
- Add Validator
composer require symfony/validator
- Add Security
composer require symfony/security-bundle
- Add Verify email bundle
composer require symfonycasts/verify-email-bundle
- Add Doctrine annotations
composer require doctrine/annotations
- Add mailer
composer require symfony/mailer
- Add Rate limiter
composer require symfony/rate-limiter
- Add Php Unit test framework
composer require --dev symfony/test-pack
- Add doctrine test bundle
composer require --dev dama/doctrine-test-bundle
- Add doctrine fixtures
composer require --dev doctrine/doctrine-fixtures-bundle
- Add component messenger
composer require symfony/messenger
- Add Doctrine Transport
composer require symfony/doctrine-messenger
- This is a fork of dunglas/symfony-docker
- This fork is for personal use only
- This fork is not intended to be used by anyone else
- This fork is not intended to be used in production
- Run
docker compose build --no-cache
- Create
.env
- Run
docker compose up -d --wait
- Run
docker compose exec php sh
to enter the container - Run inside container
php bin/console about
to check the Symfony version - To access the application, open
https://localhost:4443
in your favorite web browser - To stop the application, run
docker compose down --remove-orphans
- Pictures generated by Dall-e
- Check the Symfony version
php bin/console about
- Check routers
php bin/console debug:router
- Check Autowire Classes
php bin/console debug:autowiring
- Regenerate app secret
php bin/console make:command regenerate-app-secret
or by opensslopenssl rand -hex 32
- Clear cache
php bin/console cache:clear
- List all parameters
php bin/console debug:container --parameters
- Doctrine create database
php bin/console doctrine:database:create
- Doctrine create entity
php bin/console make:entity
- Doctrine create migration
php bin/console make:migration
- Doctrine migrate
php bin/console doctrine:migrations:migrate
- Create Form
php bin/console make:form
- Create Controller
php bin/console make:controller
- Create User
php bin/console make:user
- Create Auth
php bin/console make:auth
- Create manually hash a password
php bin/console security:hash-password
- Create registration
php bin/console make:registration-form
- Create the test database
php bin/console --env=test doctrine:database:create
- Create the tables in the test database
php bin/console --env=test doctrine:schema:create
- Create the fixtures
php bin/console make:fixtures
- Load the fixtures
php bin/console doctrine:fixtures:load
- Create application test
php bin/console make:test
- Run all tests
php bin/phpunit
- Debug messenger to see all the configured handlers
php bin/console debug:messenger
- Consumer messages
php bin/console messenger:consume async
orphp bin/console messenger:consume async -vv
- show all failed messages
php bin/console messenger:failed:show
- Debugging events
php bin/console debug:event-dispatcher
orphp bin/console debug:event-dispatcher event_name