直接贴docker-compose.yaml文件
version: '3'
services:
postgres:
image: postgres
container_name: postgres
restart: always
environment:
- POSTGRES_USER=sonar
- POSTGRES_PASSWORD=sonar
networks:
- sonar
sonarqube:
image: sonarqube
container_name: sonarqube
restart: always
ports:
- "9000:9000"
environment:
- SONARQUBE_JDBC_URL=jdbc:postgresql://postgres:5432/sonar
networks:
- sonar
networks:
sonar:
external: false
启动命令
docker-compose up -d
访问
访问9000端口,用户名密码 admin/admin
网友评论