N4si / DevSecOps-Project

DevSecOps Project to setup Netflix clone on AWS using CICD, Security, Monitoring and GitOps
343 stars 1.65k forks source link

Persistent Data and Configuration for SonarQube Docker Container #7

Open talatghafoor opened 9 months ago

talatghafoor commented 9 months ago

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.

talatghafoor commented 9 months ago

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]