- 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
Both Docker and Docker Compose are required on the host to run this code
- Install Docker Engine: https://docs.docker.com/engine/install/
- Install Docker Compose: https://docs.docker.com/compose/install/
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
Once configured the containers can be brought up using Docker Compose
-
Set the environment variables and build the images
docker-compose build
-
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
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
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.