docker-compose 搭建 sonarqube8.2 + postgresql12

你离开我真会死。 提交于 2020-03-11 12:48:33

废话不多说上代码


version: '3'
services: 
  postgres:    
    image: postgres:12   
    restart: always
    container_name: postgres
    ports:
      - 5432:5432
    volumes:
      - /opt/postgres/postgresql/:/var/lib/postgresql
      - /opt/postgres/data/:/var/lib/postgresql/data
    environment:
      TZ: Asia/Shanghai    
      POSTGRES_USER: sonar   
      POSTGRES_PASSWORD: sonar123
      POSTGRES_DB: sonar
    networks: 
      - sonar-network
  sonar:
    image: sonarqube:8.2-community
    restart: always 
    container_name: sonar
    depends_on:
      - postgres
    volumes:
      - /opt/sonarqube/extensions:/opt/sonarqube/extensions
      - /opt/sonarqube/logs:/opt/sonarqube/logs
      - /opt/sonarqube/data:/opt/sonarqube/data
      - /opt/sonarqube/conf:/opt/sonarqube/conf
    ports:
      - 9000:9000
    environment:
      SONARQUBE_JDBC_USERNAME: sonar
      SONARQUBE_JDBC_PASSWORD: sonar123
      SONARQUBE_JDBC_URL: jdbc:postgresql://postgres:5432/sonar
    networks: 
      - sonar-network
networks:
  sonar-network:
    driver: bridge

参考链接

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!