https://github.com/dockerbound-immortal/mern-nginx
Docker MERN stack React, MongoDB, Mongo-Express, Node, & Nginx Gateway.
https://github.com/dockerbound-immortal/mern-nginx
docker-containers mongo-express mongodb nginx nodejs reactjs
Last synced: 12 days ago
JSON representation
Docker MERN stack React, MongoDB, Mongo-Express, Node, & Nginx Gateway.
- Host: GitHub
- URL: https://github.com/dockerbound-immortal/mern-nginx
- Owner: Dockerbound-Immortal
- Created: 2021-03-27T17:33:40.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-03-28T11:01:22.000Z (almost 5 years ago)
- Last Synced: 2024-12-01T00:16:26.051Z (about 1 year ago)
- Topics: docker-containers, mongo-express, mongodb, nginx, nodejs, reactjs
- Language: JavaScript
- Homepage:
- Size: 226 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MERN Stack
A basic MERN stack, there is another version of this in which Nginx is used a as a gateway to the application allowing for faster static file transfers, and more secure communication between the client and API.
This can be restructured into microservices.
## Nginx
This container works differently to my other compose projects.
Only a single point of entry is exposed on port: :8080. From this nginx acts as a gateway to handle routing to either the client or the api
Client Routes:
- [localhost:8080/](http://localhost:8080/)
API Routes:
- [localhost:8080/api/](http://localhost:8080/api/)
Mongo Express:
- [localhost:8081/](http://localhost:8081)
To get started, make sure you have [Docker installed](https://docs.docker.com/docker-for-mac/install/) on your system, and then clone this repository.
Next, navigate in your terminal to the directory you cloned this, and spin up the containers for the web server by running `docker-compose up -d --build`.
- **react** - `:3000`
- **mongodb** - `:27017`
- **mongo-express** - `:8081`
- **node** - `:3000`
- **nginx** - `:8080`
## Persistent Mongo Storage
Persistent storage is handled by a docker volume, this ensures that when you take down and spin up containers your data is not lost.
## Networked
Everything in this docker setup is networked to ensure it can only communicate with each other. This makes this project akin to a single service built with a separate client and api.