Skip to content

Landing page for fresaclub - using MERN stack (Mysql Express React Nodejs) and dockerize it

License

Notifications You must be signed in to change notification settings

FresaClubWallet/landingpage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Landing page Fresa - MERN stack docker (Mysql Express React Nodejs)

  • Use Express Nodejs as backend
  • Use React script as frontend
  • Use MySQL as the database (v8)
  • Include self-signed SSL certificate (Let's Encrypt localhost format)
  • You can use make command to build fast

Table of contents

Host requirements

Both Docker and Docker Compose are required on the host to run this code

Configuration

Copy the env.example file as .env in both folder backend & frontend then populate according to your environment Create ssl folder in backend folder and copy your fullchain.pem & privatekey.pem

Deploy

Once configured the containers can be brought up using Docker Compose

  1. Set the environment variables and build the images

    docker-compose build
  2. Bring up the landing page containers

    docker-compose up -d 

    After a few moments the containers should be observed as running

    $ docker-compose ps
    Name                  Command               State                                   Ports
    -----------------------------------------------------------------------------------------------------------------------------
    landingpage   docker-entrypoint.sh pm2-r ...   Up      0.0.0.0:443->443/tcp,:::443->443/tcp, 0.0.0.0:80->80/tcp,:::80->80/tcp

Teardown

For a complete teardown all containers must be stopped and removed along with the volumes and network that were created for the application containers

Commands

docker-compose stop
docker-compose down

Notes

Let's Encrypt SSL Certificate

Use: https://github.com/RENCI-NRIG/ez-letsencrypt - A shell script to obtain and renew Let's Encrypt certificates using Certbot's --webroot method of certificate issuance.