r/PHPhelp • u/SeriouslyYoutube • Nov 20 '21
Should I use Docker?
I'm a PHP (mostly laravel) developer. I currently use laragon as my dev env. I love to move to docker, because to try and learn it. But building dockerfile and for each project is a pain in the ass. Is there any other dev friendly way to create dockerfile? Or should I continue using laragon? (I heard about Laravel Sail, But some of my projects are not fully laravel)
2
u/compsciscrub Nov 21 '21
Lando is built on top of docker compose. I use it for pretty much everything PHP. They have “recipes” for certain configs that shorten the setup process.
2
4
u/CptIceberg Nov 20 '21
You should try Ddev, its a wonderfull tool which allow you to benefit from a fully containerized env without having to setting it up yourself ! It adapts automatically to the project too (Laravel, Symfony, Drupal, Wordpress). Its absurdly easy and powerfull
4
u/vimsee Nov 21 '21
I always recommend techworld with nana. She explains things very good.
2
u/SimpleMinded001 Nov 21 '21
I'm also a fan of her videos. She explains everything so well! Can't recommend enough.
2
u/biinjo Nov 21 '21
Pro tip; go to Udemy.com and get yourself a docker course from Bret Fisher. He’s the best teacher. It took me about 7 days to get from nothing to a solid production environment.
Bonus; a lot of courses are just $10 now due to Black Friday.
In addition, serversforhackers.com has a great course about setting up Laravel + Docker dev and production environments as well. Slightly more expensive than $10 but worth every penny since Chris shares some very useful bash scripts I still use today.
2
u/SiegFuse Nov 21 '21
Not long ago i have prepared some small docker configuration for myself - https://github.com/Fresh-Advance/development. You can try it out too, and improve if something is missing for your special case.
If you need backend only stuff, remove unneeded containers from docker-compose which you get after `make up` command. Check the readme.
Sadly there are no php8 right now, but i am planning to add that container variant as well soon.
1
u/Sensitive_Pianist_92 Nov 21 '21
Tou can read about laravel sail - it uses docker, the whole installation takes a few minutes.
Besides that, you can read how to usedocker and set up all the env on DigitalOcean site
1
u/benelori Nov 21 '21
After you learn the basics you will realize that you can reuse the same docker file across projects
0
u/AnnualPanda Nov 21 '21
If what you're doing is working for you there is no reason to change it.
People are sometimes adopting technology that is beneficial for specific use cases and then random people start thinking they need to know/use it too because it is a new buzzword.
Don't be one of those people. Make analytical decisions about what is best for what you're doing
Note: it's good to have a general understanding about new tech, but it doesn't mean you have to use it if it's not appropriate
2
u/SeriouslyYoutube Nov 21 '21
The problem is, The current company I'm working on doesn't use Docker, So I'm safe. But I'm planning to move to a better company. All of the good ones use Docker. So I need to learn. Before I move.
5
u/chocolombia Nov 20 '21
Hi there, when I first started with docker I used to have tons of issues, specially understanding the logic behind it and as you say, setting up dockerfiles, entry points, compose, etc etc, was a headache, nowdays it's my #1 en tool, starting from the fact that changing something is crazy easy, to the fact that everything is standard from dev to prod, nowdays my life is way easier, and handling the whole dev cicle has never being this easy.
Edit: look for the standard images, I work with the official php, plus some twiks that I need for the CMS I use, and work has never being easy