-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
75 lines (61 loc) · 2.56 KB
/
Copy pathdocker-compose.yml
File metadata and controls
75 lines (61 loc) · 2.56 KB
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
66
67
68
69
70
71
72
73
74
75
version: '3.8'
services:
jenkins:
image: jenkins/jenkins:lts
user: root
container_name: jenkins-devsecops
ports:
- "8081:8080"
- "50001:50000"
volumes:
- jenkins_home:/var/jenkins_home
- /var/run/docker.sock:/var/run/docker.sock
- ./scripts:/scripts:ro
- ./security:/security:ro
environment:
- JAVA_OPTS=-Djenkins.install.runSetupWizard=false -Xmx2g
- JENKINS_OPTS=--httpPort=8080
restart: unless-stopped
command: >
bash -c "
echo '🚀 Starting Jenkins DevSecOps Setup...' &&
# Update package manager
apt-get update &&
# Install essential tools
apt-get install -y curl wget python3 python3-pip jq git docker.io &&
# Install security tools
echo '🔐 Installing Gitleaks...' &&
curl -sSfL https://github.com/zricethezav/gitleaks/releases/download/v8.18.0/gitleaks_8.18.0_linux_x64.tar.gz | tar -xz &&
mv gitleaks /usr/local/bin/ &&
echo '🛡️ Installing Trivy...' &&
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin v0.46.0 &&
echo '🐳 Installing Hadolint...' &&
wget -O hadolint https://github.com/hadolint/hadolint/releases/download/v2.12.0/hadolint-Linux-x86_64 &&
chmod +x hadolint && mv hadolint /usr/local/bin/ &&
echo '📦 Installing Python security tools...' &&
pip3 install detect-secrets semgrep checkov bandit safety &&
echo '🔧 Installing additional tools...' &&
wget -O kube-score.tar.gz https://github.com/zegl/kube-score/releases/download/v1.16.1/kube-score_1.16.1_linux_amd64.tar.gz &&
tar -xzf kube-score.tar.gz && mv kube-score /usr/local/bin/ && rm kube-score.tar.gz &&
# Configure Git
git config --global --add safe.directory '*' &&
git config --global user.email 'jenkins@devsecops.local' &&
git config --global user.name 'Jenkins DevSecOps' &&
# Set permissions
chmod +x /scripts/*.sh 2>/dev/null || true &&
echo '✅ DevSecOps tools installation completed!' &&
echo '🔧 Security tools available:' &&
gitleaks version &&
trivy version &&
hadolint --version &&
semgrep --version &&
checkov --version &&
echo '🚀 Starting Jenkins...' &&
/usr/local/bin/jenkins.sh
"
volumes:
jenkins_home:
driver: local
networks:
default:
name: devsecops-network