Skip to content

This repo helps you understand how to containerize a mern stack app and deploy using docker-compose

Notifications You must be signed in to change notification settings

a47741753/MERN-docker-compose

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

A simple MERN stack application

Create a network for the docker containers

docker network create demo

Build the client

cd mern/frontend
docker build -t mern-frontend .

Run the client

docker run --name=frontend --network=demo -d -p 5173:5173 mern-frontend

Verify the client is running

Open your browser and type http://localhost:5173

Run the mongodb container

docker run --network=demo --name mongodb -d -p 27017:27017 -v ~/opt/data:/data/db mongodb:latest

Build the server

cd mern/backend
docker build -t mern-backend .

Run the server

docker run --name=backend --network=demo -d -p 5050:5050 mern-backend

Using Docker Compose

docker compose up -d

About

This repo helps you understand how to containerize a mern stack app and deploy using docker-compose

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 96.2%
  • Dockerfile 1.8%
  • HTML 1.7%
  • CSS 0.3%