docs icon indicating copy to clipboard operation
docs copied to clipboard

Lando recipe for SonarQube

Open tormi opened this issue 1 year ago • 0 comments

Here's the Lando recipe for SonarQube:

.lando.yml

name: sonar

proxy:
  sonar:
    - sonar.lndo.site:9000

services:
  db:
    type: postgres:15
    portforward: true
    overrides:
      environment:
        POSTGRES_USER: postgres
        POSTGRES_PASSWORD: ''
        POSTGRES_DB: database
  # @see: https://github.com/SonarSource/docker-sonarqube/tree/master/10/community
  # @see: https://github.com/SonarSource/docker-sonarqube/blob/master/example-compose-files/sq-with-postgres/docker-compose.yml
  sonar:
    type: lando
    ssl: true
    sslExpose: false
    depends_on:
      - db
    services:
      image: sonarqube:10.4-community
      command: "/opt/sonarqube/docker/entrypoint.sh"
      volumes:
        - sonarqube_data:/opt/sonarqube/data
        - sonarqube_extensions:/opt/sonarqube/extensions
        - sonarqube_logs:/opt/sonarqube/logs
      ports:
        - "9000:9000"
    overrides:
      environment:
        # Lando webroot via environment variable.
        LANDO_WEBROOT: /opt/sonarqube/web
        SONAR_JDBC_URL: jdbc:postgresql://db:5432/database
        SONAR_JDBC_USERNAME: postgres
        SONAR_JDBC_PASSWORD: ''

volumes:
  sonarqube_data:
    driver: local
  sonarqube_extensions:
    driver: local
  sonarqube_logs:
    driver: local

# Tested with Lando version.
version: v3.21

.gitignore

# SonarQube volume directories.
sonarqube_data
sonarqube_extensions
sonarqube_logs

README.md

## Environments

### Local environment

1. Install the latest [Lando](https://docs.lando.dev/install).
2. Start the site by running `lando start`.
3. Access the site at <https://sonar.lndo.site>. Initial login credentials are `admin`/`admin`.

tormi avatar Feb 22 '24 08:02 tormi