networks: network: traefik_network: external: true volumes: postgresql: postgresql_data: services: app: image: sonarqube:10.7-community depends_on: postgresql: condition: service_healthy labels: - "traefik.docker.network=traefik_network" - "traefik.enable=true" - "traefik.http.routers.sonarqube.rule=Host(`${SONAR_FQDN}`)" - "traefik.http.routers.sonarqube.entrypoints=websecure" - "traefik.http.routers.sonarqube.tls.certresolver=myresolver" networks: - traefik_network - network volumes: # https://github.com/mc1arke/sonarqube-community-branch-plugin - ./plugins/sonarqube-community-branch-plugin-1.19.0.jar:/opt/sonarqube/extensions/plugins/sonarqube-branch-plugin.jar environment: - SONAR_JDBC_USERNAME=${POSTGRES_USERNAME} - SONAR_JDBC_PASSWORD=${POSTGRES_PASSWORD} - SONAR_JDBC_URL=jdbc:postgresql://postgresql:5432/sonar - SONAR_WEB_JAVAADDITIONALOPTS=-javaagent:./extensions/plugins/sonarqube-branch-plugin.jar=web - SONAR_CE_JAVAADDITIONALOPTS=-javaagent:./extensions/plugins/sonarqube-branch-plugin.jar=ce deploy: replicas: 1 restart_policy: condition: any delay: 5s postgresql: image: postgres:11 networks: - network environment: - POSTGRES_USER=${POSTGRES_USERNAME} - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} volumes: - postgresql:/var/lib/postgresql - postgresql_data:/var/lib/postgresql/data deploy: replicas: 1 restart_policy: condition: any delay: 5s healthcheck: test: [ "CMD-SHELL", "sh -c 'pg_isready -U ${POSTGRES_USERNAME} -d sonar'" ] interval: 1s timeout: 5s retries: 10