2019-08-07 docker-compose-sonar-
version: '3'
services:
sonar:
image: "sonarqube:7.6-community"
ports:
- 9000:9000
- 9092:9092
restart: always
links:
- mysql
container_name: "sonar"
#command: "bin/run.sh"
#volumes:
# - ./sonar_base/:/opt/sonarqube/
environment:
- "SONARQUBE_JDBC_USERNAME=root"
- "SONARQUBE_JDBC_PASSWORD=123456"
#- "SONARQUBE_JDBC_URL=jdbc:mysql:///sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance&useSSL=false"
- "SONARQUBE_JDBC_URL=jdbc:mysql://mysql:3306/test?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance&useSSL=false"
mysql:
image: mysql:5.7
ports:
- 3306:3306
restart: always
container_name: "sonar_mysql"
volumes:
- ./sonar_mysql/:/var/lib/mysql/
environment:
- "MYSQL_ROOT_PASSWORD=123456"
可以考虑 sonarqube:lts-alpine 版本,大小 315M, yml里用的版本镜像大小为866M。
本文标题:2019-08-07 docker-compose-sonar-
本文链接:https://www.haomeiwen.com/subject/jvfodctx.html
网友评论