This project provides a Docker Compose setup for running SonarQube and Jenkins, which can be used as part of a CI/CD pipeline to improve code quality and automate parts of the software development process.
Docker Compose is a tool for defining and running multi-container Docker applications. With Compose, you define a multi-container application in a single file, then spin up your application in a single command. Compose makes it easy to orchestrate and manage your containers, networks, and volumes.
This Docker Compose project includes two services:
SonarQube is an open-source platform for continuous inspection of code quality. It provides detailed reports on code coverage, bugs, vulnerabilities, and code smells.
The sonarqube service is created using the sonarqube:lts image. It exposes the SonarQube web interface on port 9000 and is connected to the mynetwork network.
The service also uses the following volumes:
SonarQube_data: stores the SonarQube data files.
SonarQube_extensions: stores the SonarQube extensions.
SonarQube_logs: stores the SonarQube logs.
These volumes are created automatically and can be accessed from the host machine.
Jenkins is an open-source automation server that helps to automate parts of the software development process. It can be used to build, test, and deploy software.
The jenkins service is created using the jenkins/jenkins:lts image. It exposes the Jenkins web interface on port 8081 and is connected to the mynetwork network.
The service also uses the following volumes:
jenkins_home: stores the Jenkins home directory.
/var/run/docker.sock: allows Jenkins to communicate with the Docker daemon.
/usr/local/bin/docker: allows Jenkins to run Docker commands.
The privileged and user options are set to run the Jenkins container with root permissions.
To get started with this project, make sure you have Docker and Docker Compose installed on your machine.
SonarQube: http://localhost:9000
Jenkins: http://localhost:8081
The volumes section is used to persist data for the SonarQube and Jenkins services.
The networks section is used to create a custom network for the SonarQube and Jenkins services to communicate on.