Setting up a robust development environment is a crucial step for any developer, and Docker has become an invaluable tool for achieving this. Docker allows you to create isolated and reproducible environments, making it easier to manage dependencies and streamline development workflows. In this blog post, we will guide you through creating a development environment using Docker and integrating Redis and MongoDB, two popular databases often used in web development.
Before we dive into the details, make sure you have the following prerequisites:
-
Docker installed on your system. You can download and install Docker from the official website (https://www.docker.com/get-started).
-
A code editor or Integrated Development Environment (IDE) of your choice.
-
Basic knowledge of Docker commands and containers.
git clone https://github.com/techsimpledotin/docker-rest-express-redis-mongo-container.git
cd docker-rest-express-redis-mongo-container
docker compose up
### test route
http://localhost:4000
### Get All users
http://localhost:4000/users
### Create User
POST http://localhost:4000/users
content-type: application/json
{
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"password": "mysecretpassword"
}
### Delete ALl users
DELETE http://localhost:4000/users