This project demonstrates setting up a Continuous Integration and Continuous Deployment (CI/CD) pipeline using Jenkins and Docker for a Python application.
Dockerfile
: Defines the Docker image for the Python application.Jenkinsfile
: Contains the Jenkins pipeline configuration.docker-compose.yml
: Orchestrates Docker containers for the application and Jenkins.requirements.txt
: Lists the Python dependencies.manage.py
: Entry point for the Python application.pipeline/
: Directory containing application-specific code.
- Docker installed on your system.
- Docker Compose installed.
- Basic understanding of Jenkins and Docker.
-
Clone the Repository:
git clone https://github.com/KevDen01/Jenkins-Docker-Python-CI-CD-Pipeline.git cd Jenkins-Docker-Python-CI-CD-Pipeline
-
Build and Start the Docker Containers:
docker-compose up --build
This command builds the Docker images and starts the containers as defined in
docker-compose.yml
. -
Access Jenkins:
- Open your browser and navigate to
http://localhost:8080
. - Follow the on-screen instructions to set up Jenkins.
- Open your browser and navigate to
-
Configure the Jenkins Pipeline:
- In Jenkins, create a new Pipeline job.
- Set the pipeline script to use the
Jenkinsfile
from this repository.
-
Run the Pipeline:
- Trigger the pipeline build in Jenkins.
- Monitor the build process and ensure all stages complete successfully.
-
Starting the Application:
The application is managed through Docker Compose. Use the following command to start the application:
docker-compose up
-
Running Tests:
Tests are defined within the pipeline and are executed during the build process.
Contributions are welcome! Please fork the repository and submit a pull request.