This Node.js Express application manages a bookstore and connects to a MongoDB database.
-
Clone the Project:
git clone https://github.com/yourusername/bookstore-app.git cd bookstore-app -
Set Up MongoDB:
Create a
.envfile in the project root:PORT=5000 MONGODB_URI=mongodb://username:password@your-mongodb-host:27017/BookStore?retryWrites=true&w=majority
Replace
username,password, andyour-mongodb-hostwith your MongoDB credentials and host information. -
Build and Run the Docker Image:
docker build --tag=sol:latest . docker run -it -p 5000:5000 --rm --name=sol sol:latest -
Access the App:
Open http://localhost:5000 in your browser.
To stop the Docker container, press Ctrl+C in the terminal.
-
Check the
.envfile for MongoDB configuration. -
Adjust MongoDB connection string if needed.
Atik