Skip to content
This repository was archived by the owner on Apr 21, 2020. It is now read-only.

teecke/gp-sonarqube

Repository files navigation

DEPRECATED

Please visit https://github.com/ayudadigital/gp-sonarqube

Generic Platform - Sonar Service

Overview

Docker image and docker-compose sample configuration to bring up a Sonar Service to the Teecke Docker Generic Platform (GP).

Configuration

The service is formed by two containers:

  • sonarqube: based on SonarQube docker image.
  • sonardb: based on PostgreSQL databasse docker image.

Operation

  1. Configure the following elements on the docker host as it figures on the SonarQube Docker hub documentation.

    sysctl -w vm.max_map_count=262144
    sysctl -w fs.file-max=65536
  2. Create the .env file based on the .env.dist template and configure the Postgres password:

    $ cp .env.dist .env
    $ cat .env
    POSTGRES_USER=sonar
    POSTGRES_PASSWORD=[PUT_YOUR_POSTGRES_PASSWORD_HERE]
    $ vim .env
    
    [...]
    
    $ cat .env
    POSTGRES_USER=sonar
    POSTGRES_PASSWORD=sonar
  3. Use the docker-compose.yml.sample file as your docker-compose configuration file.

  4. Install assets

  5. Start with docker-compose up -d.

  6. Open the url http://localhost:9000 in a browser to access to the SonarQube gui and complete the configuration.

  7. Manage backups of your files:

    1. Make a backup executing docker-compose exec -u root sonarqube backup.
    2. Find the current backup within the /var/backups/gp/sonarqube/ of the container.
    3. Extract the current backup executing docker cp $(docker-compose ps -q sonarqube):/var/backups/gp gp.
  8. Stop the platform with docker-compose stop.

There are two volumes created with the database. All data and configuration are on those volumes, so never delete it.

$ docker volume ls|grep sonarqube
local               gp-sonarqube_postgresql
local               gp-sonarqube_postgresql_data

You can use this docker piece with the Docker Generic Platform project.

Known issues

None known