Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sujaykundu777/mern-docker
Jumpstart your MERN Full Stack App development :pilot:
https://github.com/sujaykundu777/mern-docker
docker docker-compose express mern mongodb react
Last synced: 3 months ago
JSON representation
Jumpstart your MERN Full Stack App development :pilot:
- Host: GitHub
- URL: https://github.com/sujaykundu777/mern-docker
- Owner: sujaykundu777
- Created: 2019-09-02T09:42:57.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T22:53:36.000Z (about 2 years ago)
- Last Synced: 2024-10-12T19:35:14.251Z (4 months ago)
- Topics: docker, docker-compose, express, mern, mongodb, react
- Language: JavaScript
- Homepage: https://dev.to/sujaykundu777/utilizing-the-power-of-docker-while-building-mern-apps-using-mern-docker-4olb
- Size: 2.3 MB
- Stars: 98
- Watchers: 5
- Forks: 65
- Open Issues: 33
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## MERN-Docker - Starter for building MERN Apps using Docker
![MERN DOCKER diagram](https://github.com/sujaykundu777/mern-docker/blob/master/3-tier-diagram.png?raw=true)
### Prerequisites:You must have Docker Installed in your System !
### How to run the App :
Article - ![Tutorial](https://dev.to/sujaykundu777/utilizing-the-power-of-docker-while-building-mern-apps-using-mern-docker-4olb)
##### In Development Mode :
First copy the content of **docker-compose-dev.yml** to **docker-compose.yml**
and also copy the content of **server/src/index.dev.js** to **server/src/index.js**
Run the app using :
`$ docker-compose up --build --remove-orphans`
or
`$ docker-compose up -d`
Above command will start the services on (-d) detach mode (similar like running the app in background)
Then you can check the status of the containers by running:
`$ docker ps`
The App should be App :
visit client : http://localhost:3000
visit server : http://localhost:8080
To check the status of the running containers :
`docker-compose ps`
##### In Production Mode :
First copy the content of **docker-compose-prod.yml** to **docker-compose.yml**
and also copy the content of **server/src/index.prod.js** to **server/src/index.js**
Run the app using :
` $ docker-compose up --build -remove-orphans`
The App should be up at http://localhost:8080
### Build the image for server :
docker build -t myapp-server:1 .
docker images
docker run --name "myapp-server" -p 80:8080 myapp-server:1
docker ps