This repository is a template for setting up a Node.js application using Docker for containerization. It provides a multi-stage Dockerfile setup for installing dependencies, building the application, and creating a production-ready Docker image.
.dockerignore- Specifies files and directories to exclude from the Docker build context..gitignore- Specifies intentionally untracked files to ignore for Git version control.Dockerfile- Multi-stage Dockerfile to build and run the Node.js application.LICENSE- The MIT license under which this template is provided.README.md- Documentation describing the repository's purpose and contents.
The Dockerfile is divided into three stages:
- Builder: Installs production dependencies.
- Compiler: Compiles the application from TypeScript (if applicable).
- Production: Creates the production image with only necessary files.
To use this template, follow these steps:
-
Clone the repository to your local machine.
-
Customize the
Dockerfileas needed for your application. -
Build your Docker image using the following command:
docker build -t your-app-name . -
Run your Docker container using the following command:
docker run -d -p 3000:3000 your-app-name
This project is licensed under the MIT License - see the LICENSE file for details.
For more information on Docker and containerization, visit the official Docker documentation.