mkdir -p /docker/sonar/postgres/postgresql mkdir -p /docker/sonar/postgres/data mkdir -p /docker/sonar/sonarqube chmod 777 -R /docker/sonar/sonarqube echo "vm.max_map_count=262144" > /etc/sysctl.conf sysctl -p
version: '3' services: postgres: image: postgres:latest container_name: postgres restart: always privileged: true volumes: - /docker/sonar/postgres/postgresql:/var/lib/postgresql - /docker/sonar/postgres/data:/var/lib/postgresql/data - /etc/localtime:/etc/localtime:ro ports: - "5432:5432" environment: POSTGRES_USER: sonar POSTGRES_PASSWORD: sonar POSTGRES_DB: sonar TZ: Asia/Shanghai sonar: image: sonarqube:8.9.10-community container_name: sonar restart: always privileged: true volumes: - /docker/sonar/sonarqube/logs:/opt/sonarqube/logs - /docker/sonar/sonarqube/conf:/opt/sonarqube/conf - /docker/sonar/sonarqube/data:/opt/sonarqube/data - /docker/sonar/sonarqube/extensions:/opt/sonarqube/extensions ports: - "9090:9000" links: - "postgres:postgres" environment: ALLOW_EMPTY_PASSWORD: "yes" SONARQUBE_JDBC_USERNAME: sonar SONARQUBE_JDBC_PASSWORD: sonar SONARQUBE_JDBC_URL: "jdbc:postgresql://postgres:5432/sonar"
默认账号密码:admin,admin
标签:compose,postgresql,postgres,sonarqube,sonar,docker,源代码,data From: https://www.cnblogs.com/raorao1994/p/17408673.html