This repository contains a Node.js API built with TypeScript and Dockerized for easy deployment. The project includes a GitHub Actions workflow for automated testing, building, and pushing Docker images to Docker Hub.
You can find the article for this repository Here for a detailed guide.
- Node.js: JavaScript runtime for building server-side applications.
- TypeScript: Typed superset of JavaScript that enables better code organization and maintainability.
- Docker: Containerization platform for packaging, distributing, and running applications.
Make sure you have the following tools installed on your machine:
git clone https://github.com/Abeinevincent/nodejs_ts_api_with_docker/
Pull the Docker Image
sudo docker pull abeinevicenthome/node_ts_api_with_docker:latest
Build the image
sudo docker build -t node_ts_api_with_docker:development --target development .
Run the docker container
sudo docker run -p 8800:8800 -v $(pwd):/usr/src/app -e PORT=8800 node_ts_api_with_docker:development
Visit http://localhost:8800 in your browser to access the Dockerized API.
Ensure to set the following environment variables:
MONGODB_URL: Your MongoDB database connection URL
JWT_EXPIRY_PERIOD: JWT token expiry period
JWT_SEC: JWT secret key for token generation
The repository includes a GitHub Actions workflow that automates testing and Docker image building on each push to the master branch.
You can contribute by crating an issue or a pull request
- Fork the repo (https://github.com/Abeinevincent/nodejs_ts_api_with_docker)
- Create your feature branch (
git checkout -b feature/sampleFeature
) - Commit your changes (
git commit -m 'Add some sampleFeature'
) - Push to the branch (
git push origin feature/sampleFeature
) - Create a new Pull Request
MIT