Imagine you just came up with a new greatest idea ever and can't wait to think it through. You believe in code! You're the programmer! Aye, lets start coding! Now!
So, if you're reading this, chances are you're going to build next one billion $ app with Symfony, the 4, because why not, Mark did it in PHP so can you!
But, hold on my friend... ha ha ha... need to set up that god damned Symfony stack first. And hey, its PHP, can't just run PHP, need bloody web server. And a database. And ideally, your new billion $ app will need some users, so User entity and perhaps you the uber admin of the newly created universe. And you know, Docker... hipsters love Docker and Docker and a bunch of other marketing bullshit words could increase your valuation, so... why not.
You can clone it and focus on what you really wanna do - coding the app, without having to glue the bloody framework components first and mess with any DevOpsish stuff.
Because I've just spent 5 hours of my life on bootstraping a fucking framework... It had taken me a shitload more time when I did it the first time, duh.
Here's how to use this crap, clone it first though.
You can find the docker-compose.yml here, but uhm... docker-compose is just too long command to my taste, so I wrapped it around with Make, so:
make build down up
It will build Docker images with PHP, MySQL and Nginx and start them with the /portal directory mounted to the PHP and Nginx containers, so no need to reload Docker when to run changes.
Life would be too easy if you hadn't to set up a database, so here it goes:
make purge install
First, purge will remove the old DB and install will create it again with Doctrine to build the structure and populate it with some data with Doctrine Fixtures.
What is life without logs?
make logs
That will tail to all containers logs, should be helpful enough.
We all know when we test we test in prod, but... just for clarity sake:
make test
No, its not just PHPUnit, because guess what... it takes just too fucking long to wait for a PHPUnit process to run all test, its not 1990 anymore, my shitty laptop can run 8 threads in parallel now. Test are run with Paratest which is a parallel PHPUnit.
Assumming you're lucky enough to actually run this crap successfully, you can open the following links in your browser: Portal
- http://localhost:55080/ Admin
- http://localhost:55080/admin admin@domain.tld / s3cr3t
- Placeholder for the portal landing
- User login and logout
- User registration
- Password reminder
- Admin panel with Easyadmin
- Admin management
- User management
- Mailing
- Templates
- Symfony 4
- Easyadmin for /admin
- Doctrine ORM
- Doctrine Fixtures with Nelmio Alice
- Twig
- Swiftmailer
- PHPUnit (Paratest)
- Symfony Encore (for frontend stuff)
- Docker
- PHP 7.2 (FPM)
- Nginx
- MySQL
Feel free to send me a pull request.
You can buy me a beer when you meet me. I mean, scotch's good either ;)