-
-
Save stijn-dejongh/8e33b432f7e2a7e698133bf710f6b66a to your computer and use it in GitHub Desktop.
Run SonarQube and SonarScanner in Docker-compose
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # Based on https://hub.docker.com/_/sonarqube | |
| # | |
| version: "3.7" | |
| services: | |
| sonarqube: | |
| container_name: sonarqube | |
| image: sonarqube:7.9.2-community | |
| ports: | |
| - "9000:9000" | |
| environment: | |
| - SONARQUBE_JDBC_URL=jdbc:postgresql://db:5432/sonar | |
| - SONARQUBE_JDBC_USERNAME=sonar | |
| - SONARQUBE_JDBC_PASSWORD=sonar | |
| networks: | |
| - sonarnet | |
| volumes: | |
| - sonarqube_conf:/opt/sonarqube/conf | |
| - sonarqube_data:/opt/sonarqube/data | |
| - sonarqube_logs:/opt/sonarqube/logs | |
| - sonarqube_extensions:/opt/sonarqube/extensions | |
| - sonarqube_bundled-plugins:/opt/sonarqube/lib/bundled-plugins | |
| db: | |
| container_name: sonardb | |
| image: postgres | |
| networks: | |
| - sonarnet | |
| environment: | |
| - POSTGRES_USER=sonar | |
| - POSTGRES_PASSWORD=sonar | |
| volumes: | |
| - postgresql:/var/lib/postgresql | |
| - postgresql_data:/var/lib/postgresql/data | |
| sonarscanner: | |
| container_name: sonarscanner | |
| image: newtmitch/sonar-scanner | |
| networks: | |
| - sonarnet | |
| volumes: | |
| - ./:/usr/src | |
| networks: | |
| sonarnet: | |
| volumes: | |
| sonarqube_conf: | |
| sonarqube_data: | |
| sonarqube_logs: | |
| sonarqube_extensions: | |
| sonarqube_bundled-plugins: | |
| postgresql: | |
| postgresql_data: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # per https://hub.docker.com/_/sonarqube | |
| # to be executed before launching the app | |
| sysctl -w vm.max_map_count=262144 | |
| sysctl -w fs.file-max=65536 | |
| ulimit -n 65536 | |
| ulimit -u 4096 |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Manually run analysis for any sonar supported language (without build tool).
=> see: https://gist.github.com/Warchant/0d0f0104fe7adf3b310937d2db67b512#gistcomment-3754312