Use GitHub Actions to Deploy a Dockerized Node.js Service
The goal of this project is to dockerize a simple Node.js service and deploy it to a remote server using GitHub Actions. You will also practice secrets management.
There are 4 parts to this project:
You are required to create a simple Node.js service with two routes:
/
route - which simply returns Hello, world!
/secret
route - protected by Basic AuthProject should have a .env
file with the following variables:
SECRET_MESSAGE
- the secret message that the /secret
route should returnUSERNAME
- the username for the Basic AuthPASSWORD
- the password for the Basic AuthWhen user visits the /secret
route, they should be prompted for the username and password. If the username and password are correct, they should be able to see the secret message. If the username and password are incorrect, they should see an error message.
Create a Dockerfile for the Node.js service that will build a Docker image. You should be able to run the Docker image locally. Make sure that the .env
file is not included in the Docker image.
Setup a remote Linux server on either DigitalOcean, AWS, or any other provider. You can either set it up manually by using SSH or use a mix of Ansible or Terraform from previous projects.
Create a workflow that will build a Docker image and push it to the container registry. The workflow should then deploy the Docker image to the remote server. Feel free to explore secrets management in GitHub Actions. I will leave the implementation details to you.
Once you are done with the project, you will have practiced dockerizing applications, setting up remote servers, implementing CI/CD workflows and secrets management.
Actively Maintained
We are always improving our content, adding new resources and adding features to enhance your learning experience.
Join the Community
roadmap.sh is the 7th most starred project on GitHub and is visited by hundreds of thousands of developers every month.
Roadmaps Best Practices Guides Videos FAQs YouTube
roadmap.sh by @kamrify @kamrify
Community created roadmaps, best practices, projects, articles, resources and journeys to help you choose your path and grow in your career.
Login to your account
You must be logged in to perform this action.