This project serves as a starting point for Node.js applications using Docker, offering an encapsulated, optimized, and scalable environment.
The project follows a standard Node.js application setup, providing a solid foundation for your apps.
-
Initialize your Node.js app in a Docker container:
docker run -it -w /usr/src/app -v "$(pwd):/usr/src/app" node:20 npm init -y
-
For Linux users, create an alias for npm:
alias npm='docker exec -it <id-of-your-image-created> npm'
-
Run the containers:
docker-compose up
-
Copy the .env.example to .env and set your environment variables.
cp .env.example .env
MongoDB is included as a database for your Node.js application. It provides a scalable and flexible solution for handling data, making it a popular choice for many applications.
Feel free to customize this project according to your specific requirements.
Happy coding!