No more Docker for PHP
ฝัง
- เผยแพร่เมื่อ 11 ก.ค. 2024
- I no longer use Homebrew to manage the dependencies for my local web development! And I definitely don't use Docker.
Links:
Laravel Herd: herd.laravel.com/
nodenv: github.com/nodenv/nodenv
DBngin: dbngin.com/
Timestamps:
00:00 So long Homebrew (and Docker)
00:40 Managing PHP versions
01:39 Interacting with Laravel Herd
03:20 Vanity local domains
05:07 Multiple Node versions with nodenv
06:25 Multiple database versions - วิทยาศาสตร์และเทคโนโลยี
Using Docker to run a basic web development environment is like firing up a gasoline-powered generator in your kitchen to run a toaster. "ISN'T THIS COOL!? IT HAS IT'S OWN POWER SOURCE! I SAID IT HAS IT'S OWN POWER! YEAH! IT'S KINDA NOISY AND YOU HAVE TO GO OUTSIDE TO BREATHE BUT THIS IS SO MUCH BETTER TRUST ME ah crap, it died. Okay, pull that cord a few times to start it back up. Use the choke. Not too much. Aww man you flooded it. Just... wait and it usually fixes itself in a day."
💀💀💀
You're a thousand percent right
Once i was kinda forced to run Docker for a project. The team lead insisted on using it. Every week i had to reinstall everything because the mysql container for some reason corrupted the database, regardless of putting the PC to sleep or shuting it down. It was a nightmare! Not to mention the level of CPU usage. IMO if you are using docker just to make sure everyone is on the same version, you should have better programmers.
I have never read a more accurate description of anything in my life
Lmfao man this is so true 😂
This is exactly how I felt about Docker after trying Laravel Sails. After realizing that I made so many compromises to my usual workflow that culminated in a ridiculous amount of context switching, I threw in the towel. There are legitimate use cases for Docker, I'm sure, but I'm not sold on using it for local dev.
Aaron's dev content is like fresh air
I appreciate that 🤗
You could have mentioned that: "Herd is a native macOS application written in Swift and will not work on Windows or Linux. There are currently no plans to support other operating systems."
The reason docker exists is so that you can have your dev team be in sync with the devops->production team. You can do what you want but this is sure a good way to burn a whole lot of bridges and wall yourself in.
Sure! There are great reasons to use docker, it's just that none of them apply to me. I didn't say it was bad, just that I don't want to use it 🤗
Damn... this is a killer for anything that goes on production.
Noone got MacOS servers, lmao, not even Apple.
Herd also doesn’t run on older versions of MacOS
@@iFunkMasterJ wow... just... wow. This gets better and better! LMAO
All our servers a linux, most of the devs are mac, a few are Windows. Works fine. The Windows people are closer to the servers because of WSL2 than the macs, but it still works fine. That's why you have ci/cd and testing environments, right.
You must do rare stuff to get into issues (like install npm packages that require a headless-chrome that works fine under Mac but not on a Linux box without XWindows installed).
If you really worry about this, use docker as a testing platform but once you know something works you'll want to work locally I guess.
Don't fear Docker. Everyone will betray you, but containers never will.
It’s not fear, it’s contextual distaste based on deep understanding.
Also; your post is a lie.
@@JeremyAndersonBoiseelaborate
Proxmox with LXC never failed me.
Theres an easy way. Docker just complicate things
Thanks for doing another great video, Aaron! I use DDEV but eager to try something simpler. BTW I think you're a terrific human being, You are just one of the brightest and nicest humans I have ever glanced, keep the hard work and thanks for your effort.
Well that's one of the nicest comments I've ever gotten 🥹 Thank you so so much for saying that.
I use DDEV to and love it, I thinks it's pretty simple and so nice to work with
DDEV is awesome, but I was running with some issues in delay and slow reloads, as it depends on lots of docker stuff like mutagen, tried everything, nothing would work to speed it up. Just wanted to share that I tried Herd yesterday for this project and, well, running outside docker is so fast! Like old days XAMMP/MAMP but way better, thank you again sir.
As a devoted Linux user I have a lot of compassion for the developers who are still stuck with convoluted MacOS or Windows development setups. I would never accept that my development workstations/laptops are working differently than the Linux production servers. It is such a relief to have the identical OS everywhere instead of having to deal with all the differences of OS setups and environments. The level of proficiency you get over the years with a Linux desktop makes you also a much better server DevOp.
All respect to people that use Linux as their main machine, but I'm simply not willing to do it! I like my Mac.
@@aarondfrancis There are some good reasons for not using Linux, e.g. when you want to use heavily Adobe products. Beside that using e.g. a KDE (Plasma) desktop distribution (e.g. Kubuntu) gives you the by far most advanced desktop on earth. Initial learning curve and configuration creates some pain but that is paying off big time on the long run.
What a nice video Aaron! Thanks for this, I didn't know about this DBngin sounds interesting. But I will keep with docker compose to manage my dbs. It's so easy!
Dbngin is great!
Nice video. I have always suffered having to manage lot of containers for different versions and mounts. This is awesome. Stay bright and more content please 🎉
I have been using Laragon for over 3 years and have never had any problems with it on Windows. I think Windows needs some love and some support from the official Laravel team.
The credit goes to Laragon, not Windows. Laragon is the best PHP stack manager; it only needed to be native on Linux to be perfect.
@mkGarf
I used XAMPP for years on Windows, but I switched to Laragon and never looked back
Hey Aaron, this is awesome! Im a new dev and always used to run into issues & problems so, this approach is like OMG "This is the way" thanks man I really appreciate it :-)
That was pretty interesting and helpful, thanks Aaron for sharing these things! 👍
You're welcome! Always trying to share what I'm learning 💪
I feel the same about Docker, while it's a cool tech but it's overkill for what I need.
I used to use IIS as my local web server and it has an extension called PHP Manager which makes it very easy to change php version per project/site but not more than that.
Also, I remember Apache can be configured to load a specific version using htaccess file.
Thanks Aaron! that was really helpful.
Keep it up👍
laragon is awesome. really good option for non docker dev
@@kirayamato6128 Very neat indeed, Thanks
Love your videos mate, keep them up ❤
Awesome tips Aaron - thank you!
Some developers think its a contest to have the most complex dev environments. I love the simplicity and this is going to be super helpful for my team. Required viewing.
As someone who has been heavily invested in Docker for local development for the past 5 years, I really think this back to basics approach can help many, many projects. I am definitely going to try this out. Thanks for great video Aaron
Cool setup! I do something similar with `asdf`, a version manager for _everything_. Granted, setting it up is a bit more involved than Laravel Herd, but once it's set up you can have all your CLI tools' versions in a `.tool-versions` file (similar to how `.node-version` works!) and it'll automatically use it. I use this for setting the PHP, node, and sometimes Python/Go versions for projects I'm involved in.
Well well well isn't that interesting! I've heard good things about asdf but only vague stuff. I like the automatic changing, I didn't realize asdf did that. I'll have to investigate! Thank you
I tried asdf yesterday for crystal lang and it's great. Only bummer is I have to manually do asdf add for any plugin that's not listed by default
asdf is the best imo
You are not an idiot, you are doing a great job. Thanks !
🥹 thank you!
Great video! I only use docker recently to test out OSS such as metabase where its complex to set it up, otherwise local env is the way to go. With my 2019 macbook pro intel with only 128 GB, I always uninstall docker and remove all images to get back all the lost disk space! Also, I can toast bread on the mac while docker is running 😅
DBEmgine looks to be quite neato, new to me, and I thank you, yet again.
This is a great video! My company uses “Lando” to manage our setups. It’s an abstraction layer for docker, and it works fine. But docker/Lando always felt overkill for my own personal projects.
Learning that Laravel Herd works for Symfony (my personal favorite framework, sorry) and learning about DBngin is the information I needed to finally make that switch (I already used “n” for node versions).
Thanks for always dropping such valuable information!
Oh nice, I haven't heard of Lando! And don't be sorry haha, I have no problems with Symfony! Just never used it 🤗
I also use Lando, it's much easier than "raw" Docker, a couple of lines in the recipe file and you get the environment ready
i just loved your setup
It is amazing.
Thank you for sharing!
Please Aaron keep releasing these useful videos, it's very useful.
I dislike Docker too! Now i feel safe😅
This is your safe space! 🫶 😂
You lost me at "for macOS". =) I used a Mac once, but it was strange and confusing. Yes, I know lots of devs love Macbooks and the like, but I've been using Windows since 3.1 and it's my safe space 🤣
Great video Aaron! I recently switch from docker to herd and dbngin and it’s night and day with regards to performance. I do have issues with non laravel projects that don’t have a public directory though (e.g. Craft) and the herd documentation is a bit lacking on how to configure this… Any suggestions?
You might look into the Laravel Valet docs. Herd is built on top of Valet, so most of it should apply!
I use Mamp Pro for years but it's a bit slow and I never tried Laravel Herb because I actually thought it was for Laravel projects only, and since I only do custom PHP, I think I'll give it a go and also the DBngin. Again, great simple to use, direct and accessible content, love it as always!
PS. Actually I'm still using Apache and i'm not sure my clients shared servers support nginx. If they do I'll have to update all my .htaccess routes, but I'll still give it a try.
Thank you! I'm always trying to be direct and provide value. Glad it was helpful 🤗
What do you use for your db client? Also, I use Windows. Is all this software compatible with Windows?
I use Table Plus! Mentioned near the very end. It's not all compatible with windows, unfortunately
Great video as always Aaron!
For some reason I didn’t realize that DBngin allowed to create Redis databases, thank you that!
I think the only thing most apps have that you didn’t mention is emails. How do you handle it for local development?
Nice! I haven't tested emails locally in a long time, but I have used MailTrap historically. And the same team that built Herd also built a tool called Helo for that beyondco.de/software/helo
Cool stuff, been thinking the same of ditching docker takes up way too much cpu and other unwanted garb
i used valet. and i still dont think im moving to herd right now. but this video is good explaining herd. Thank you Aaron
What if you need to run 2 or more simultaneous apps with different node versions, different php versions or different mysql versions? I think docker solves that quite easily, but otherwise it seems complicated using multiple versioning tools to do this, right?
That'd be a good reason to use docker! That's not a situation I find myself in though
Great video. I had similar approach once with Xampp, I believe. For the automatic node versioning I used nvm in combination with avn. But nodenv looks way faster. Nice!
I only recently found nodenv, coming from nvm. It's been great so far! Auto switching is 👌👌👌
@@aarondfrancis will try it out. Thank you 😁
I ditched nvm couple of years ago for a tool called Volta. It's super fast and you can also pin node/npm/yarn/pnpm versions inside a project's package.json file and it will automatically switch to those versions when you cd into the project directory. I work in an agency and we work on multiple projects in parallel and having to not worry about correct node/npm version for each project is great.
Ever since we started using Volta, we totally got rid of issues caused by using wrong nodejs version when installing dependencies and just running into weird issues because it's easy to forget to manually switch to right nodejs version using nvm. It's also easy to upgrade nodejs in a project because when you pin a new version, devs working on that project will just get automatically switched to that version without having to worry about it at all.
@@rand0mtv660 yeah, we did the same with nvm and avn combined. Worked pretty well. Volta sounds promising :)
I'm a lifelong windows user, recent mac+laravel+herd convert.
Reason for switching is purely speed, windows just can't handle Laravel.
Biggest issue with the new setup is it doesn't have much much support for htaccess, only the basics Laravel/Wordpress use, so it only supports a few PHP frameworks, not PHP in general 😞.
Check out the Laravel valet docs, you can write a custom driver for anything you might need!
I love your attitude! Is there a easy way to get pretty urls without the .php extension in herd? It's so easy to do in Apache with tons of examples using .htaccess, but I can't find anything using herd and/or nginx.
Hm that should be handled by default! I've never had to change anything to make that work in Herd or Valet
@@aarondfrancis thanks I’ll have to recheck! To be clear I am talking about vanilla php and not Laravel. Thanks again!
I also prefer to use the command line, but I couldn't find the command to start and stop mysql (DBngin). Any ideas, how to do that? Thanks.
Nope, not sure unfortunately!
One curse with our industry is that if suffers from unnecessary complexity. We have this weird idea that the more complicated something is the better tool it is. I used Laragon for the longest time then moved to Laravel Herd when i switched to Mac from Windows. I refuse to learn complex tools that add nothing significant.
I used to work with contao long time ago.. I kinda liked it.. did you ever work with or on that?
Never even heard of it 🙊
Love me a bit o the ol docker
🤢
Just an update here: now Laravel Herd can also manage node versions, databases, and even more services like Redis, Meilisearch, Reverb... so you *only* need Herd 🔥 (Also available for Windows now)
For a moment, I thought you were going to mention "Laragon".
greats infos sir , Merci!
What is your solution if php version 5.6 is needed? Herd currently don't support PHP 5 I think.
Oooo ummm I don't know. Why... do you need 5.6?
@@aarondfrancis Plenty of old apps out there. That means a steady paycheck for many.
Pretty neat tools. I wish they were available for Windows or Linux, especially the laravel herd, that looks super nice.
I think Herd is working on windows support!
I really have to learn Docker. I now use Valet Linux Plus for my Laravel prjects, and it's great, but I know in the future I will have to learn Docker.
I feelt like Docker just got in the way of me learning Laravel and basic virtual machine functions. It is just another extra thing I have to learn. I was hoping it will go away, but it's here to stay.
in my case i have to use docker for example to use meilisearch or others services
I'm on the waitlist for herd on windows - they say for later march 24. I use windows with WSL as that gives me a 'real' linux with minimum fuss.
That said, docker is how I deploy into production, so docker is generally the way I go for dev, mostly.
I really want to like it, but I can't see what it offers over what I already get with brew.
Also, it doesn't have some PHP extensions I need (e.g. php-ldap) and requires homebrew anyway if you want to use those.
I also don't need to switch PHP versions very often.
It doesn't have apache, so harder to test changing settings before doing so in production (in my environments that use apache, which are most).
Finally, it doesn't support my preferred TLD (I don't want to use .test).
Interesting how it works without modifying the hosts file...?
For all the fiddly bits for multiple sites (apache virtualhosts and modifying of my /etc/hosts file) I have it all nicely bash scripted up anyway. (This also does extras like creates my DB and modifies my laravel .env file accordingly etc)
Not meaning to sound negative - it looks very cool and super useful, but not for me at this point.
That's totally ok! I appreciate the thoughtful reply. I know it's not gonna be for everyone. It sounds like you have a solid setup already, so I would probably stick with that as well.
I was there... It's amazing and fast and easy until one enters enterprise world. Multiple deployment targets, environments, it's soon hell to maintain it all. I hated Docker but after I learned thanks to work, I love that I build the Image once and it works everywhere.
Herd is great but it stays on the Mac. There are VPS, Kubernetes, etc that need matching environment and that's where docker wins:)
How do you deploy this in production?
Thanks for share!!
Thanks again A Aron
🫡🫡
Hello! Anyone has a solution for using Herd with Google API auth? The .test TLD is not accepted by Google API and I then need to find a way to rewrite the redirect url with Herd.
`herd tld` lets you set the tld
@@aarondfrancishey thanks for the reply.
I kept the default .test TLD but I found my solution which I shared in Laracasts. I cannot paste a link here but the thread started with “How do I make a custom local domain for Laravel Herd projects?”. Cheers!
What happens when you have a team of 5-10 developers, with multiple machines / OS versions? 🤔
Well then that would be a totally different situation! You'd have to figure out what works for you
I ended up using valet for dns and php and Takeout for mysql, redis, mailpit etc. Because I don't want to install all that stuff natively. Herd could be even better (than valet; with it's statically built phps), but I didn't find how to write custom drivers for it :)
Hmmm Herd uses valet under the hood so I imagine you could check the valet docs
currently a docker, home brew, nvm user now anxiously hoping nothing bad happens to my environment 😂
May God have mercy on you
Looks great! Makes you wish it ran on OSs other than MacOS.....
Oh it looks like you found a way to replace single docker with bunch of different applications just to manage few language engines. It works untill you want to support deployment configuration and local env configuration separately, and untill you need to install redis/memcached/kafka/rabbitmq/etc/etc/etc then it will be the same zoo + Docker.
same setup :) except node version i use NVM
Wish Linux had something like this.
when it works docker is great ... I personally hated having to tinker with it when things go wrong... soooo many many issues with containers comunicating between themselves permission issues and what not just a nightmare. What seemed to work was putting every single thing into a single container but I guess that's not the docker way. just hours upon hours wasted for nothing.
not working in catalina or linux
whats the problem with docker?
No problem! I just don't need it and it feels overly heavy and slow for my use case
yeah, last time docker prune command removed 13gb of data 😖
but more importantly, where is Livewire Spa Video?
Next on my list!
I dont use Docker, but probably it a great use when you have half team on Mac and half on Windows ))
Interesting tool
For PHP development, I use and love Laragon on Windows😶🌫
That's awesome!
Why are you against Docker? Would be interested to hear your thoughts, since generally people like it.
I just find it to be really heavy, and not useful for my needs. I think for big teams or complicated setups it's probably awesome! I just like a light weight alternative
@@aarondfrancis Valid point, they use the wrong Ubuntu image IMHO which is nearly 700MB.
Brew is useful for much more than that. I don't want to get "There's a new version, click here to update" popup every time I open something
Sounds like brew is a good fit for you then! That's awesome
cool... how about Windows?
Not supported right now, unfortunately!
I also don't like docker and don't use it, but, herd is not available for linux... :(
Clicked on this hoping for a nix video. Damn 😢.
Damn
great solution if you're planning on running everything from your macbook...
Thanks!
Thanks
What about Laragon?
I use Laragon on PC, same easy shit!
ok!
i feel like laravel herd was made SPECIFICALLY for mac users
People that work on linux have it simple, and on windows things sometimes work sometimes dont
Yeah it's definitely mac only. I imagine it's hard to make 3 truly native apps, but I've never done it so I can't say for sure
Us folks with Windows really are missing out 😢
docker is easily the best way
Maybe for certain definitions of "easily"
@@aarondfrancis easy to use, easy to do literally anything
I'm docker user, docker is not the best way.There is no best and easily way for everything. We just have some ways to solve life problems. I think we never will have something ideal, because life actually too complicated and your code and infrastructure earlier or later(depends on your skills) will be messy.
Laradock is working just fine to me
Then by all means continue to use it
It's great, the only problem is that is macOS
Personally prefer Valet + PHPMon + DBngin
So you use a lot of different tools to do what 1 docker image will do...
:yes:
"never used docker"
this is me, jealous 😭😭😭
Idk why all the docker hate, and all the comments about CPU doesn't make any sense to me. I do use Linux exclusively, perhaps other OS gives a less than optimal docker experience.
LARAGON IS NICE AND LIGHTWEIGHT
NICE I'LL CHECK IT OUT
Have you ever heard of peanut butter and jelly?
I prefer Mac and cheese
@@aarondfrancis same tbh
Gret video... but Herd not having a Linux and Windows client is a deal killer for me.
an entire setup for noobs would be great, taking it from a clean mac.
Wait we're allowed to just say "I just don't want to"? I didn't know this was an option...
Wild right? You're welcome
Prerequisite macOS
Im on Windows here, go for docker
well some of us broke devs dont have macos.
Ah, now I need to get a mac😢😅
😭😭 I know, kind of a bummer. So many good tools for mac!
@@aarondfrancis whyyyyy😭. Guess I'll give the mac a try in the future then
Looks neat, too bad it doesn't run on linux servers.
windows and linux users : wut
I know, bummer these aren't available there!
You need k8s tho
do i
Why are most Laravel devs using Mac?
Not sure that most are, but macs are very good and very popular so it makes sense that many are
We need Herd for Windows, Laragon is great but not as great as Herd.
I agree! I think they're working on something
he's proud of being not being different. that basically nothing to be proud of. just an ordinary user.. LOL,
🌶️🌶️🌶️🌶️🌶️🌶️🌶️🌶️🌶️🌶️🌶️🌶️🌶️🌶️
💅💅💅