Instead of mounting a volume, you can now use docker compose watch feature in copy mode to make docker copy files into the container once they are changed.
@@CristianJesus2002 The most important for me is it eliminates problem of setting UID and GID of files. It makes files inside your developer environment run exactly the same as they would run on built image. The lesser gap between production and dev environment the better.
Air is okay for basic projects, but for things where you want to run different commands depending on which files change I much prefer cespare/reflex and watchexec/watchexec
It's not the only thing air can do but if you just want to live reload your project, and I mean any project, just use entr. I've never had to use anything else and it works with just about anything.
Great video. Wasnt aware that live reloading was also possible with golang. Is there a way to apply this concept with kubernetes? I have a configuration that requires a connection to a mongodb instance which is only accessible within the cluster. I could port-forward the database everytime i want to test something, but that would kinda defeat the purpose of convinience I think.
Was a bit confused `-v /app/tmp` because you said "so temp directory that we defined in the toml file" but it is not defined in 3:47. Is it maybe just the default GOTMPDIR for air or the docker image?
I may be the only one but I just don’t understand what docker buys you. Like, what would be the point of dockerizing your project locally? Or on server? It just feels so overkill to me
The advantage is, that you build your app in the same environment as you deploy it later. Furthermore, if you work on an app with a colleague, both of you are using the same environment with zero setup.
docker allowed code to run anywhere no matter the OS that docker itself can run so it makes deploying to cloud simple. Its like bash scripts but with a vm and tools to manage your app in an isolated environment
It's generally nice to have your dev environment and prod environment to be roughly similar, so that you don't run into issues in prod that didn't exist in dev
guys if you have problems with the hot reloading try to add poll = true in the .air.toml after that it worked for me.... (think its some windows bullshit)
I hope you enjoy the video! Comment + like and subscribe if you did :)
Instead of mounting a volume, you can now use docker compose watch feature in copy mode to make docker copy files into the container once they are changed.
What is the benefit of copying the files instead of just mounting the directory?
@@CristianJesus2002 The most important for me is it eliminates problem of setting UID and GID of files. It makes files inside your developer environment run exactly the same as they would run on built image. The lesser gap between production and dev environment the better.
Yep - im aware.
But this focused on not introducing docker-compose, but instead just a Docker file
I'm curious why not use docker compose?
air is pretty amazing! The fact that you can get live reloading with the logs support makes app building in Go so much fun.
Yeah it really is great
I want to see more go content: microservices, observability and many more.
okay! thank you
You are the go specialist on my UA-cam :)
yay - thank you
Air is okay for basic projects, but for things where you want to run different commands depending on which files change I much prefer cespare/reflex and watchexec/watchexec
Actually useful video, thank you.
It's not the only thing air can do but if you just want to live reload your project, and I mean any project, just use entr. I've never had to use anything else and it works with just about anything.
Great video. Wasnt aware that live reloading was also possible with golang. Is there a way to apply this concept with kubernetes?
I have a configuration that requires a connection to a mongodb instance which is only accessible within the cluster. I could port-forward the database everytime i want to test something, but that would kinda defeat the purpose of convinience I think.
I havent played around with live reloading with k8 in depth - but I would assume there must be something like that
I' d love github repos of stuff you upload.
Was a bit confused `-v /app/tmp` because you said "so temp directory that we defined in the toml file" but it is not defined in 3:47. Is it maybe just the default GOTMPDIR for air or the docker image?
I have a question, what's the advantages of running the go project in a docker container instead of just running it locally?
This is a great question, but its for containerising your environment
I had a problem when using CGO. different glibc version between my local and the remote one. docker solved it
Nice video..
but why the hell do you have the lines numbers upside down 🙃
nice work :)
Thank you
Biggest problem with dockerizing Go dev environment is debugging. It gets pretty nasty when you need to make it work.
Yeah, it can for sure
Yeah i agree, you can check your logs in docker desktop and observe your container logs, it helps alot tho.
@@Dr.thrtle I meant code debugging using breakpoints.
I may be the only one but I just don’t understand what docker buys you. Like, what would be the point of dockerizing your project locally? Or on server? It just feels so overkill to me
same, hope someone could explain why I should do this for local. thx!
The advantage is, that you build your app in the same environment as you deploy it later. Furthermore, if you work on an app with a colleague, both of you are using the same environment with zero setup.
Hmm... so you are one of those "works on my machine" kind of guys?
docker allowed code to run anywhere no matter the OS that docker itself can run so it makes deploying to cloud simple. Its like bash scripts but with a vm and tools to manage your app in an isolated environment
@@dyto2287 Of course, is there any other way to work? LMAO
Why not develop using air without docker and dockerize after everything is done?
i dont think i ever said you cant do this
@@MelkeyDev no I mean, why dockerizing it first. Just curious, what's the benefit
But why?
yes
@@MelkeyDev ah I see
Every time I install docker it messes up my network.
Are you on Windows?
@@MelkeyDev Debian. Haven't used windows in ages.
"HELP ON COBOL AND FEE..."? 🤔
??? what
@@MelkeyDev Bottom left in your VS Code. 😊 Was wondering what's going on.
how to do this for NodeJs?
why tf you need docker for local development with live reloading? why dont you use just air. there is no reasons to dockerize your app locally
It's generally nice to have your dev environment and prod environment to be roughly similar, so that you don't run into issues in prod that didn't exist in dev
no views in 1 minute, bros fallen off
Shut up man the UA-cam algorithm is weird for tech UA-cam
ouch
guys if you have problems with the hot reloading try to add poll = true in the .air.toml after that it worked for me.... (think its some windows bullshit)
booooooo windows
Docker > Golang
great reference
Not this again!!