This repository demonstrates the implementation of a robust CI/CD pipeline for a Next.js project using Docker. The setup ensures seamless building, testing, and deployment of the application, leveraging containerized environments for consistency and reliability.
For inquiries, collaborations, or support, feel free to reach out:
- 🎮 Discord:
cashblaze127
- 📱 Telegram: @cashblaze127
- 💼 LinkedIn: Keyvel Bitcoin Solana
-
Dockerfile
Defines the application containerization process for building and running the Next.js project. -
docker-compose.yml
Simplifies multi-container setup, ensuring smooth orchestration for local development and production environments. -
deploy.yml
Automates the deployment workflow using GitHub Actions, facilitating continuous integration and deployment.
- Build Stage
- Docker builds the Next.js application image using the Dockerfile.
- Dependencies are installed, and the application is compiled.
- Test Stage
- Run automated tests to validate the application functionality.
- Deployment Stage
- The deploy.yml GitHub Actions workflow pushes the Docker image to a container registry (e.g., Docker Hub or AWS ECR).
- Deploys the container to the desired environment (e.g., AWS, DigitalOcean, or a Kubernetes cluster).
- Docker and Docker Compose installed on your system.
- Access to a container registry (Docker Hub, AWS ECR, etc.).
- A configured GitHub repository for CI/CD integration.
- Clone the repository:
git clone https://github.com/cashblaze127/CI-CD-NextJs.git
cd CI-CD-NextJs
- Build and run the container locally:
docker-compose up --build
- Push changes to the GitHub repository to trigger the CI/CD pipeline:
- GitHub Actions will handle the build, test, and deployment stages defined in the
deploy.yml
file.
A multi-stage Dockerfile to optimize the build process:
Defines services for local development:
GitHub Actions workflow for CI/CD:
- Containerized development environment for Next.js.
- Automated testing and deployment using GitHub Actions.
- Simplified multi-container orchestration with Docker Compose.
- Scalable and production-ready architecture.