N4si/DevSecOps-Project

Persistent Data and Configuration for SonarQube Docker Container

Opened this issue · 1 comments

Issue Description

Currently, when running the SonarQube Docker container, the settings and state are not persisted between container restarts. This leads to a loss of configuration and data upon server restarts, which is inconvenient and can lead to data loss or misconfiguration.

Solution Description

To enable persistence of data and configuration in the SonarQube Docker container, follow these steps:

  1. Create Docker volumes:

    docker volume create sonarqube_data
    docker volume create sonarqube_conf
    
    docker run -d --name sonarqube \
    -p 9000:9000 \
    -v sonarqube_data:/opt/sonarqube/data \
    -v sonarqube_conf:/opt/sonarqube/conf \
    [Insert Image ID]