fred-lab / docker_mern

A ligthweight Docker environment to run NodeJS application with ExpressJS and MongoDB. The ExpressJS server is in "server" folder, you can add a React app at the root and start the server with a npm command (like : npm run dev --prefix server).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Docker environment for a Nodejs application

A ligthweight Docker environment to run NodeJS application with ExpressJS and MongoDB. The ExpressJS server is in "server" folder, you can add a React app at the root and start the server with a npm command (like : npm run dev --prefix server).

Quick Start

  • Clone this repo : git clone https://github.com/fred-lab/docker_mern.git

  • Create a .env file : cp .env.dist .env
    Edit the values as you see fit

  • Install server dependencies : npm install --prefix server

  • Start a server : For production environment, use the NodeJS server : npm run prod --prefix server
    For development environment, use the Nodemon (to automatically reload the NodeJS server when a change is done on the server): npm run dev --prefix server
    The NodeJS server provide the application on http://localhost:3000 by default.

  • You can, now, create a project at the root of this folder

About

A ligthweight Docker environment to run NodeJS application with ExpressJS and MongoDB. The ExpressJS server is in "server" folder, you can add a React app at the root and start the server with a npm command (like : npm run dev --prefix server).

License:MIT License


Languages

Language:Shell 41.5%Language:JavaScript 27.1%Language:Dockerfile 22.1%Language:HTML 9.3%