ganeshmani / cloudnweb-comments

This Repo is a comment section for my blog cloudnweb.dev
0 stars 0 forks source link

Building a Production - Ready Node.js App with TypeScript and Docker #3

Open utterances-bot opened 3 years ago

utterances-bot commented 3 years ago

Building a Production - Ready Node.js App with TypeScript and Docker

In this article, we will see how to build a Nodejs, TypeScript Application and deploy it to server with Docker.

https://cloudnweb.dev/2019/09/building-a-production-ready-node-js-app-with-typescript-and-docker/

Crono1981 commented 3 years ago

Correct me if I'm wrong here but this will copy the full directory content into the docker image, including development dependencies and the original typescript code. Feels a bit bloated to me...

itxtoledo commented 3 years ago

bad practice, this will copy all dev dependencies to production server

lingdocs commented 2 years ago

This is dangerous because mongo will be exposed on port 27017 to the outside world. When you include "PORTS" in the docker-compose file it also opens that port to the outside world through the server's firewall.

ganeshmani commented 2 years ago

Thank you for the valuable feedback. i will be revamp this article with best practices.

lingdocs commented 2 years ago

Here's some discussion/explanation on that issue of exposing databases by accident. I also just learned about this and apparently a lot of big companies have been burned by this. https://www.reddit.com/r/docker/comments/rm652z/isolating_a_network_with_docker_compose/

FrancisBehnen commented 1 year ago

Hi, maybe a disclaimer at the top that you're also a beginner yourself would be in place? Next to everything already mentioned using pm2 inside a docker is also very bad https://stackoverflow.com/questions/51191378/what-is-the-point-of-using-pm2-and-docker-together