This guide provides instructions on setting up SonarQube using Docker containers. Additionally, it includes a post-install script for automating tasks such as changing passwords, creating projects, generating tokens, and setting up quality gates.
- Docker installed on your system
- Docker Compose installed on your system
- Ensure Docker is running on your system.
- Clone the repository and navigate to it.
- Create a
.envfile with the required environment variables. - Create a data folder for PostgreSQL volume.
- Execute the following command in your terminal:
docker-compose up -dUpon running the Docker Compose setup, the index.py script will perform the following tasks:
- Change the admin password
- Log in with the new password
- Create projects specified in
config.json - Generate new tokens for the projects.
- Set up a quality gate with specified thresholds
docker run --rm -it -v $PWD:/work -w /work sonarsource/sonar-scanner-cli:latest bash