docker-compose.yml
version: '3.1'
services:
sonarqube:
image: sonarqube:8.9.9-community
container_name: sonarqube
ports:
- 9000:9000
volumes:
- /home/sonarqube/data:/opt/sonarqube/data
- /home/sonarqube/logs:/opt/sonarqube/logs
- /home/sonarqube/extensions:/opt/sonarqube/extensions
restart: always
environment:
- SONARQUBE_JDBC_USERNAME=root
- SONARQUBE_JDBC_PASSWORD=123456
- SONARQUBE_JDBC_URL=jdbc:postgresql://127.0.0.1:5432/sonar
ulimits:
nproc: 131072
nofile:
soft: 8192
hard: 131072
extra_hosts:
- "github.com:140.82.114.3"
init:
image: bash
privileged: true
user: root
volumes:
- ./init.sh:/mnt/init.sh
command: ["sh", "-e", "/mnt/init.sh"]
init.sh 初始化脚本设置系统参数
sysctl -w vm.max_map_count=524288
sysctl -w fs.file-max=131072
标签:compose,SONARQUBE,init,sh,sonarqube,home,docker
From: https://www.cnblogs.com/pgyLang/p/16662819.html