DEV Community

Discussion on: You probably don't need dotenv

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt

But, should I use Docker in development?

  • Vue CLI == Webpack dev server + proxy, which can already read .env by default, anyway
  • Node.js web server (Fastify). Cannot read .env by default.
Collapse
 
aminnairi profile image
Amin • Edited

Hi Pacharapol, thanks for your answer.

I guess, from the context you provided, that you already have the necessary tools to deal with your environment just fine. Adding Docker on top of all that would be overkill in my opinion. Don't you think?

Collapse
 
mgce profile image
Mateusz Gajda

If you are writting client side, than you don't need docker. But if you are writting server side and use some external services, than you should think about a docker. It gives you an abiliity to connect to external services by hostname, and thanks to that you can emulate production environment on your local computer. What is more docker and docker-compose is powerfull tool which can gives you a lot of benefits if know hot to use it correct.

Collapse
 
aminnairi profile image
Amin

If you are using Vue CLI on Windows and I am using it on Linux, we might come into issues with the underlying Node.js version we are using. This can cause mismatch behaviors in the way Node.js is handling things under the hood like file watching for instance (which is the common culprit among users of different operating system working together).

However, if you are working alone, you don't need Docker. Still, I continue using it even on my side-projects and my libraries because it is so much relieving not to worry about the version of Node.js that is installed on my operating system at the current moment and the Node.js version I used to develop my library at that specific time. If I really need to keep an outdated version of Node.js because I'm using a library that forced me to not upgrade Node.js, I can easily do that and keep working on my library for years. And I can upgrade the Node.js version simply by updating a file.

Infrastructure-as-code has many more advantages but I can't list them in a single comment, if you want me to write an article about it I'll be gladly off doing that and share opinions with you as well!