NodeExpressMongoDBDockerApp screenshot

NodeExpressMongoDBDockerApp

Author Avatar Theme by Danwahlin
Updated: 6 Nov 2025
177 Stars

Node.js with MongoDB Docker App Demo

Categories

Overview:

Node.js with MongoDB and Docker DemoApplication is a demonstration designed to showcase the integration and functionality of using Node.js and MongoDB within Docker containers. The application utilizes Mongoose to establish a basic database for storing Docker commands and examples.

Features:

  • Docker Integration: Demonstrates how Node.js and MongoDB can be run in Docker containers.
  • Mongoose Database: Utilizes Mongoose to create and manage a simple database for storing Docker commands and examples.
  • Easy Installation: Provides straightforward steps for starting the application using Docker containers or without Docker.

Installation:

Starting the Application with Docker Containers:

  1. Install Docker Desktop.
  2. Open a command prompt.
  3. Run the commands listed in node.dockerfile.
  4. Navigate to http://localhost:3000.

Starting the Application with Docker Compose:

  1. Install Docker Desktop.
  2. Open a command prompt at the root of the application’s folder.
  3. Run docker compose build.
  4. Run docker compose up.
  5. Open another command prompt and run docker compose ps -a to note the ID of the Node container.
  6. Run docker exec -it <nodeContainerID> sh to shell into the container.
  7. Run node dbSeeder.js to seed the MongoDB database.
  8. Navigate to http://localhost:3000 in your browser.

Running the App with Node.js and MongoDB (without Docker):

  1. Install and start MongoDB.
  2. Install the LTS version of Node.js.
  3. Adjust the host name in config/config.development.json to your MongoDB server name.
  4. Run npm install.
  5. Run node dbSeeder.js to load sample data into MongoDB.
  6. Run npm start.
  7. Navigate to http://localhost:3000 in your browser.

Summary:

The Node.js with MongoDB and Docker DemoApplication is a comprehensive demo illustrating the seamless integration of Node.js and MongoDB within Docker containers. By following the provided installation steps, users can experience the application’s functionality with or without Docker, making it a versatile tool for learning and development purposes.