# Container for running Jenkins with a local jobs volume
# Run this image via
#   - `docker-compose -f jenkins.yml -p <%= machineName %> run jenkins`
jenkins:
  image: phase2/jenkins-docker:1.9.1
  volumes:
    - ./env/jenkins/config.xml:/var/jenkins_home/config.xml
    - ./env/jenkins/jobs:/var/jenkins_home/jobs
    # Mount the docker socket so we can execute from within this container
    - /var/run/docker.sock:/var/run/docker.sock
    # Mount a stable location for the Jenkins workspace
    - /opt/development/<%= projectName %>/jenkins/env/workspace:/opt/development/<%= projectName %>/jenkins/env/workspace
  environment:
    DEVTOOLS_PRIVATE_KEY:
    DNSDOCK_NAME: jenkins
    DNSDOCK_IMAGE: <%= domain %>
    VIRTUAL_HOST: build.<%= projectName %>.ci.p2devcloud.com
    VIRTUAL_PORT: 8080

# Container for running Jenkins with a local jobs volume
# Run this image via
#   - `docker-compose -f jenkins.yml -p <%= machineName %> run jenkins`
jenkins:
  image: phase2/jenkins-docker:1.9.1
  volumes:
    # Primary jenkins configuration. Direct file mount prevents writing updates from running instance.
    - ./env/jenkins/config.xml:/var/jenkins_home/config.xml
    # Mount the local project jobs into Jenkins
    - ./env/jenkins/jobs:/var/jenkins_home/jobs
    # Mount the docker socket so we can execute from within this container
    - /var/run/docker.sock:/var/run/docker.sock
    # Mount a stable location for the Jenkins workspace
    - /opt/development/<%= projectName %>/jenkins/env/workspace:/opt/development/<%= projectName %>/jenkins/env/workspace
    # SSH key grants read access to private Git repositories.
    - ~/.ssh/id_rsa:/root/.ssh/devtools.key
  environment:
    DNSDOCK_NAME: jenkins
    DNSDOCK_IMAGE: <%= domain %>
    VIRTUAL_HOST: build.<%= projectName %>.ci.p2devcloud.com
    VIRTUAL_PORT: 8080

Switch Jenkins ssh key to use volume mount.
Switch Jenkins ssh key to use volume mount.
