Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mshahomar/af5a8d819979ee031f928ab6b5f237fa to your computer and use it in GitHub Desktop.
Save mshahomar/af5a8d819979ee031f928ab6b5f237fa to your computer and use it in GitHub Desktop.

Gist to support https://www.youtube.com/watch?v=KsTMy0920go

GitHub Repository

https://github.com/darinpope/java-web-app

use the sonar branch

SonarQube setup

Documentation: https://docs.sonarqube.org/latest/setup/install-server/#header-4

Search for the heading "Example Docker Compose configuration". The video example used the docker-compose.yml file listed below:

docker-compose.yml

version: "3"

services:
  sonarqube:
    image: sonarqube:community
    depends_on:
      - db
    environment:
      SONAR_JDBC_URL: jdbc:postgresql://db:5432/sonar
      SONAR_JDBC_USERNAME: sonar
      SONAR_JDBC_PASSWORD: sonar
    volumes:
      - sonarqube_data:/opt/sonarqube/data
      - sonarqube_extensions:/opt/sonarqube/extensions
      - sonarqube_logs:/opt/sonarqube/logs
    ports:
      - "9000:9000"
  db:
    image: postgres:12
    environment:
      POSTGRES_USER: sonar
      POSTGRES_PASSWORD: sonar
    volumes:
      - postgresql:/var/lib/postgresql
      - postgresql_data:/var/lib/postgresql/data

volumes:
  sonarqube_data:
  sonarqube_extensions:
  sonarqube_logs:
  postgresql:
  postgresql_data:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment