-
Notifications
You must be signed in to change notification settings - Fork 8
/
docker-compose.yml
51 lines (47 loc) · 1.56 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Compose file to use lequal/sonarqube image with an external database.
# Inspired from https://github.com/SonarSource/docker-sonarqube/blob/7.9.3/example-compose-files/sq-with-postgres/docker-compose.yml
#
# Examples:
# $ docker-compose up -d
# $ LEQUAL_SONARQUBE_VERSION=1.0.0 POSTGRES_PASSWD=secret-passwd SONARQUBE_ADMIN_PASSWORD="a password" docker-compose up -d
#
# lequal/sonar-scanner can then be used with the running SonarQube container.
version: "3"
services:
sonarqube:
image: "lequal/sonarqube:${LEQUAL_SONARQUBE_VERSION:-latest}"
depends_on:
- db
ports:
- "9000:9000"
networks:
- sonarnet
environment:
SONARQUBE_JDBC_URL: jdbc:postgresql://db:5432/sonar
SONARQUBE_JDBC_USERNAME: sonar
SONARQUBE_JDBC_PASSWORD: "${POSTGRES_PASSWD:-sonar}"
SONARQUBE_ADMIN_PASSWORD: "${SONARQUBE_ADMIN_PASSWORD:-pass}"
volumes:
- sonarqube_data:/opt/sonarqube/data
- sonarqube_extensions:/opt/sonarqube/extensions
- sonarqube_logs:/opt/sonarqube/logs
db:
image: postgres:12-alpine
networks:
- sonarnet
environment:
POSTGRES_USER: sonar
POSTGRES_PASSWORD: "${POSTGRES_PASSWD:-sonar}"
volumes:
- postgresql:/var/lib/postgresql
# This needs explicit mapping due to https://github.com/docker-library/postgres/blob/4e48e3228a30763913ece952c611e5e9b95c8759/Dockerfile.template#L52
- postgresql_data:/var/lib/postgresql/data
networks:
sonarnet:
driver: bridge
volumes:
sonarqube_data:
sonarqube_extensions:
sonarqube_logs:
postgresql:
postgresql_data: