version: "3.9"
services:
jenkins:
image: jenkins/jenkins:lts-jdk21
container_name: jenkins
restart: unless-stopped
# If you want Jenkins on a sub-path like /jenkins, uncomment the next line
# environment:
# - JENKINS_OPTS=--prefix=/jenkins
volumes:
- jenkins_home:/var/jenkins_home
expose:
- "8080" # internal to the compose network
# - "50000" # optional: classic JNLP agents (WebSocket usually removes the need)
networks:
- web
caddy:
image: caddy:2
container_name: caddy
restart: unless-stopped
depends_on:
- jenkins
ports:
- "80:80"
- "443:443"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile:ro
- caddy_data:/data
- caddy_config:/config
networks:
- web
networks:
web:
driver: bridge
volumes:
jenkins_home:
caddy_data:
caddy_config: