-
-
Save ferdousulhaque/f1d745997bc3c50e43d5394d74c3f625 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
sonar-project.properties | |
# must be unique in a given SonarQube instance | |
sonar.projectKey=sample1 | |
# --- optional properties --- | |
# defaults to project key | |
#sonar.projectName=My project | |
# defaults to 'not provided' | |
#sonar.projectVersion=1.0 | |
# Path is relative to the sonar-project.properties file. Defaults to . | |
sonar.sources=. | |
# Encoding of the source code. Default is default system encoding | |
sonar.sourceEncoding=UTF-8 |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment