TypeScript-Node-Starter
TypeScript-Node-Starter copied to clipboard
Added Dockerfile and docker-compose file
For ease in setting up a development environment I have added docker to this repository. Now user doesn't have to install node or mongo in their machine and can easily spawn up the starter just by running docker-compose up --build
- Added a
dockerfile
which can be used in development and production - Added
docker-compose.yml
for easily setting up starter along with mongo for development. - Added
.dockerignore
to ignore node_modules and npm log from docker
This is very helpful, since the changes are approved is there any way to get it merged into master
?
@bowdenk7 can we get this merged?
@orta sorry for disturbing you, could you please merge this awesome PR?
I left it open because I'm still undecided on whether it should go in personally. I mostly sit on the side of no.
It's rare to see people having docker containers inside their sample repos (e.g. it's not in CRA/Angular/Next/Gatsby/tsdx), and these files come with no documentation - just three extra files for someone who is learning node + TS to wonder what to do with. I get there's a set of people that would want a dockerfile, but it doesn't feel like something which we should add to this sample.
I saw this sitting out here, and agree that sample projects do not typically have dockerfiles included, but I question why. Typically, because there are few dependencies to run a project that are not built into the language, or the framework itself (ie expect to need React for a React project). I almost bailed on half of this implementation because I don't use Mongo, and don't want to install it. For that reason, I certainly will be pulling in the Dockerfile, so thank you @shamin!
I also agree that docker build/run/compose documentation should be added for the basic setup.
Instead of adding a bunch of magic to the toplevel, why not put it all in a subdirectory instead? It will complicate the docker build a little bit since the context directory is up a level, but it should be doable. A README file in that directory could then describe things properly instead, since a full description at the toplevel README is probably going to make people hesitate to accept it.