-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
65 lines (60 loc) · 1.97 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
version: "3.8" # Specify Docker Compose version
volumes:
nexus-data: {} # Define empty volume for Nexus data
jenkins-data: {} # Define empty volume for Jenkins data
postgresql-data: {} # Define empty volume for SonarQube data
services:
jenkins:
container_name: jenkins
hostname: jenkins
image: jenkins/jenkins:latest # Use latest Jenkins image
ports:
- "8080:8080" # Map container port 8080 to host port 8080 (Jenkins UI)
- "50000:50000"
volumes:
- jenkins-data:/var/jenkins_home # Persistent storage for Jenkins data
- /var/run/docker.sock:/var/run/docker.sock
- /usr/bin/docker:/usr/bin/docker
- ./daemon.json:/etc/docker/daemon.json
environment:
- JENKINS_HOME=/var/jenkins_home
# restart: unless-stopped # Restart Jenkins container unless manually stopped
sonarqube:
container_name: sonarqube
hostname: sonarqube
image: sonarqube:community
depends_on:
- db
ports:
- "9000:9000"
volumes:
- ./sonarqube/data:/opt/sonarqube/data
- ./sonarqube/extensions:/opt/sonarqube/extensions
- ./sonarqube/logs:/opt/sonarqube/logs
environment:
- SONAR_JDBC_URL=jdbc:postgresql://db:5432/sonar
- SONAR_JDBC_USERNAME=sonar
- SONAR_JDBC_PASSWORD=sonar
db:
container_name: db
hostname: db
image: postgres:12
ports:
- "5430:5432"
environment:
- POSTGRES_USER=sonar
- POSTGRES_PASSWORD=sonar
- PGDATA=/var/lib/postgresql/data/pgdata
volumes:
- postgresql-data:/var/lib/postgresql/data
nexus:
container_name: nexus
hostname: nexus
image: sonatype/nexus3:latest # Use latest Nexus image
ports:
- "8081:8081" # Map container port 8081 to host port 8081 (Nexus UI)
volumes:
- ./nexus-data:/var/sonatype-work/nexus3 # Persistent storage for Nexus data
environment:
- SONATYPE_NE=nexus # Set initial admin password (change for production)
# restart: unless-stopped