# vim:ts=2:sts=2:sw=2:et
#
# Author: Hari Sekhon
# Date: 2020-03-28 01:49:38 +0000 (Sat, 28 Mar 2020)
#
# https://github.com/HariSekhon/DevOps-Bash-tools
#
# License: see accompanying Hari Sekhon LICENSE file
#
# If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help improve or steer this or other code I publish
#
# https://www.linkedin.com/in/HariSekhon
#
# https://github.com/jenkinsci/docker/blob/master/README.md
version : '3'
services :
jenkins-server :
hostname : jenkins-server
# official repo abandoned - too old for plugins to load - unusable
#image: jenkins:2.60.3
# community version
#image: jenkins/jenkins:${VERSION:-2.228}
image : jenkins/jenkins:${VERSION:-lts}
# jenkinsci/jenkins is deprecated in favour of jenkins/jenkins but jenkins org doesn't have blueocean
# this is based off Alpine - Jenkinsfile is for Debian/Ubuntu systems like standard Jenkins, just use stock image with plugin
#image: jenkinsci/blueocean:${VERSION:-1.22.0}
ports :
- ${JENKINS_PORT:-8080}:8080
- 50000 : 50000
# doesn't auto-install, done explicitly by jenkins.sh now
#volumes:
# - ./setup/jenkins-plugins.txt:/usr/share/jenkins/ref/plugins.txt
user : root:root
# gets 403 without -Djenkins.install.runSetupWizard=false
healthcheck :
#test: ["CMD", "curl", "-f", "http://localhost:8080/login"]
# export DOCKER_HEALTHCHECK=/bin/true in development to bypass healthcheck
test : "${DOCKER_HEALTHCHECK:-curl http://localhost:8080/login}"
interval : 30s
start_period : 30s # version 3.4+
timeout : 10s
retries : 5
restart : unless-stopped
environment :
# skips creating admin user or prompting to install plugins
#JAVA_OPTS: -Dhudson.footerURL=https://github.com/harisekhon -Djenkins.install.runSetupWizard=false
JAVA_OPTS : -Dhudson.footerURL=https://github.com/harisekhon
# jenkins-agent:
# hostname: jenkins-agent
# # doesn't have an lts tag at the moment
# image: jenkins/inbound-agent:latest
# restart: unless-stopped
# environment:
# JENKINS_AGENT_NAME: agent1
# JENKINS_URL: http://jenkins-server:8080
# # need to get this from the web UI, then uncomment and set in environment - it's not visible in the Rest API :'-(
# JENKINS_SECRET: ${JENKINS_SECRET:-none}