DEV Community

kethmars
kethmars

Posted on

1

Set up Express+Mongo API server using this Docker Compose boilerplate

Last year, I had to build a couple of simple Express+Mongo API's. For convenience, I used Docker Compose to set up the necessary environments.

I thought this boilerplate may also benefit others to quickly start developing their APIs.

The project includes:

  • docker-compose.yml file for booting up a Node and MongoDB containers
  • a modified Dockerfile for installing packages and setting up ports for debugging
  • Nodemon to follow changes in projects
  • Logic to connect to DB
  • Example controllers for fetching data from MongoDB
  • launch.json for simple NodeJS debugging in VS Code

Link to the boilerplate:
https://github.com/kethmars/docker-compose-express-mongo

Have fun :)!

Top comments (2)

Collapse
 
eduaugustus profile image
Eduardo Augusto

Greate sample hahaha

Collapse
 
isajal07 profile image
Sajal Shrestha

Thanks for this boilerplated!
You saved tons of my time!
Cheers!

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay