https://github.com/nerkarso/docker-shopping-cart
This is a sample app built with Express and MongoDB running on Docker
https://github.com/nerkarso/docker-shopping-cart
docker
Last synced: 18 days ago
JSON representation
This is a sample app built with Express and MongoDB running on Docker
- Host: GitHub
- URL: https://github.com/nerkarso/docker-shopping-cart
- Owner: nerkarso
- Created: 2022-07-18T21:26:45.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-09-06T00:15:51.000Z (almost 4 years ago)
- Last Synced: 2025-08-11T07:29:42.137Z (11 months ago)
- Topics: docker
- Language: JavaScript
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Shopping Cart
This is a sample app built with Express and MongoDB running on Docker following the tutorial below.
[](https://www.youtube.com/watch?v=Kyx2PsuwomE)
## Stack
- Docker
- Node.js
- Express
- MongoDB
- ejs
## Getting Started
Follow these steps to get the app up and running.
1. Install the Node.js dependencies.
```
npm install
```
2. Make a copy of `.env.example` to `.env.development` and update the credentials.
3. Start the server in development mode.
```sh
npm run dev
```
## Production
Follow these steps to run the app in production.
1. Make a copy of `.env.example` to `.env.production` and update the credentials.
2. Create the docker container.
```sh
docker-compose up
```
## Docker Commands
**Create or destroy the docker container**
```sh
docker-compose up
docker-compose down
```
**Start or stop the web app**
```sh
docker container start shopping-cart-web
docker container stop shopping-cart-web
```
**Start or stop the database**
```sh
docker container start shopping-cart-db
docker container stop shopping-cart-db
```