Created
March 14, 2019 08:31
-
-
Save andybeak/7e4cfada899156935efca91b537fedcf to your computer and use it in GitHub Desktop.
Sonarqube in docker-compose with mysql
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
version: '3' | |
services: | |
sonarqube: | |
image: 'sonarqube:6.7.6-community' | |
restart: always | |
networks: | |
- sonarnet | |
ports: | |
- "10000:9000" | |
volumes: | |
- './sonar/conf:/opt/sonarqube/conf' | |
- './sonar/data:/opt/sonarqube/data' | |
- './sonar/logs:/opt/sonarqube/logs' | |
- './sonar/extensions:/opt/sonarqube/extensions' | |
depends_on: | |
- mysql | |
environment: | |
sonar.jdbc.username: root | |
sonar.jdbc.password: secret | |
sonar.jdbc.url: jdbc:mysql://mysql:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance&useSSL=false | |
container_name: sonarqube | |
mysql: | |
# At time of writing mysql:5.7 does not grant root user the ability to login from '%' and the MYSQL_ROOT_HOST didn't work for me. | |
image: mysql:5.6 | |
command: --default-authentication-plugin=mysql_native_password --bind-address="0.0.0.0" | |
restart: always | |
networks: | |
- sonarnet | |
volumes: | |
- './mysql/lib:/var/lib/mysql' | |
environment: | |
MYSQL_DATABASE: "sonar" | |
MYSQL_ROOT_PASSWORD: "secret" | |
MYSQL_ROOT_HOST: "%" | |
container_name: mysql | |
networks: | |
sonarnet: | |
driver: bridge |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment