/sf-6-game

Primary LanguagePHPMIT LicenseMIT

Symfony Docker

A Docker-based installer and runtime for the Symfony web framework, with FrankenPHP and Caddy inside!

CI

Getting Started

  1. If not already done, install Docker Compose (v2.10+)
  2. Run docker compose build --no-cache to build fresh images
  3. Run docker compose up --pull -d --wait to start the project
  4. Open https://localhost in your favorite web browser and accept the auto-generated TLS certificate
  5. Run docker compose down --remove-orphans to stop the Docker containers.

Features

Enjoy!

Docs

  1. Build options
  2. Using Symfony Docker with an existing project
  3. Support for extra services
  4. Deploying in production
  5. Debugging with Xdebug
  6. TLS Certificates
  7. Using a Makefile
  8. Troubleshooting

License

Symfony Docker is available under the MIT License.

Credits

Created by Kévin Dunglas, co-maintained by Maxime Helias and sponsored by Les-Tilleuls.coop.

Links

  1. Symfony Recipes
  2. Symfony Flex
  3. Symfony Twig
  4. Symfony Forms
  5. Symfony Doctrine
  6. Symfony Form types

Composer

  1. Add templates Twig packcomposer require templates
  2. Add symfony asset composer require symfony/asset
  3. Add symfony profiler composer require --dev symfony/profiler-pack
  4. Add symfony maker composer require --dev symfony/maker-bundle
  5. Add Doctrine composer require symfony/orm-pack
  6. Add Form composer require symfony/form
  7. Add Validator composer require symfony/validator
  8. Add Security composer require symfony/security-bundle
  9. Add Verify email bundle composer require symfonycasts/verify-email-bundle
  10. Add Doctrine annotations composer require doctrine/annotations
  11. Add mailer composer require symfony/mailer
  12. Add Rate limiter composer require symfony/rate-limiter
  13. Add Php Unit test framework composer require --dev symfony/test-pack
  14. Add doctrine test bundle composer require --dev dama/doctrine-test-bundle
  15. Add doctrine fixtures composer require --dev doctrine/doctrine-fixtures-bundle
  16. Add component messenger composer require symfony/messenger
  17. Add Doctrine Transport composer require symfony/doctrine-messenger

Notes

  1. This is a fork of dunglas/symfony-docker
  2. This fork is for personal use only
  3. This fork is not intended to be used by anyone else
  4. This fork is not intended to be used in production
  5. Run docker compose build --no-cache
  6. Create .env
  7. Run docker compose up -d --wait
  8. Run docker compose exec php sh to enter the container
  9. Run inside containerphp bin/console about to check the Symfony version
  10. To access the application, open https://localhost:4443 in your favorite web browser
  11. To stop the application, run docker compose down --remove-orphans
  12. Pictures generated by Dall-e

Symfony commands

  1. Check the Symfony version php bin/console about
  2. Check routers php bin/console debug:router
  3. Check Autowire Classes php bin/console debug:autowiring
  4. Regenerate app secret php bin/console make:command regenerate-app-secret or by openssl openssl rand -hex 32
  5. Clear cache php bin/console cache:clear
  6. List all parameters php bin/console debug:container --parameters
  7. Doctrine create database php bin/console doctrine:database:create
  8. Doctrine create entity php bin/console make:entity
  9. Doctrine create migration php bin/console make:migration
  10. Doctrine migrate php bin/console doctrine:migrations:migrate
  11. Create Form php bin/console make:form
  12. Create Controller php bin/console make:controller
  13. Create User php bin/console make:user
  14. Create Auth php bin/console make:auth
  15. Create manually hash a password php bin/console security:hash-password
  16. Create registration php bin/console make:registration-form
  17. Create the test database php bin/console --env=test doctrine:database:create
  18. Create the tables in the test database php bin/console --env=test doctrine:schema:create
  19. Create the fixtures php bin/console make:fixtures
  20. Load the fixtures php bin/console doctrine:fixtures:load
  21. Create application test php bin/console make:test
  22. Run all tests php bin/phpunit
  23. Debug messenger to see all the configured handlersphp bin/console debug:messenger
  24. Consumer messages php bin/console messenger:consume async or php bin/console messenger:consume async -vv
  25. show all failed messages php bin/console messenger:failed:show
  26. Debugging events php bin/console debug:event-dispatcher or php bin/console debug:event-dispatcher event_name