-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
86 lines (81 loc) · 2.74 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
version: "3.5"
services:
jenkins:
image: jenkins/jenkins:$JENKINS_TAG
container_name: "${PROJECT_NAME}_jenkins"
build:
dockerfile: Dockerfile
context: .
args:
JENKINS_TAG: $JENKINS_TAG
JENKINS_NUM_OF_EXECUTORS: $JENKINS_NUM_OF_EXECUTORS
BATS_TAG: $BATS_TAG
DOCKER_COMPOSE_TAG: $DOCKER_COMPOSE_TAG
stop_grace_period: 60s
privileged: true
restart: always
ports:
- ${JENKINS_PORT}:8080
- ${JENKINS_SLAVE_AGENT_PORT}:50000
environment:
PROJECT_NAME: $PROJECT_NAME
PROJECT_BASE_URL: $PROJECT_BASE_URL
JENKINS_TAG: $JENKINS_TAG
JENKINS_HOME: $JENKINS_HOME
JENKINS_NUM_OF_EXECUTORS: $JENKINS_NUM_OF_EXECUTORS
JENKINS_PORT: $JENKINS_PORT
JENKINS_SLAVE_AGENT_PORT: $JENKINS_SLAVE_AGENT_PORT
JAVA_OPTS: $JAVA_OPTS
JENKINS_OPTS: $JENKINS_OPTS
GITHUB_USERNAME: $GITHUB_USERNAME
GITHUB_API_TOKEN: $GITHUB_API_TOKEN
BITBUCKET_USERNAME: $BITBUCKET_USERNAME
BITBUCKET_API_TOKEN: $BITBUCKET_API_TOKEN
GITLAB_USERNAME: $GITLAB_USERNAME
GITLAB_API_TOKEN: $GITLAB_API_TOKEN
DOCKER_COMPOSE_TAG: $DOCKER_COMPOSE_TAG
BATS_TAG: $BATS_TAG
TRAEFIK_TAG: $TRAEFIK_TAG
TRAEFIK_PORT: $TRAEFIK_PORT
TRAEFIK_DASHBOARD_PORT: $TRAEFIK_DASHBOARD_PORT
PORTAINER_TAG: $PORTAINER_TAG
PORTAINER_PORT: $PORTAINER_PORT
volumes:
- ./config/jenkins_home:${JENKINS_HOME}
- ./services/jenkins:/var/jenkins
- /var/run/docker.sock:/var/run/docker.sock
labels:
- "traefik.http.routers.${PROJECT_NAME}_jenkins.rule=Host(`jenkins.${PROJECT_BASE_URL}`)"
- "traefik.http.services.${PROJECT_NAME}_jenkins.loadbalancer.server.port=${JENKINS_PORT}"
docker_compose:
image: docker/compose:$DOCKER_COMPOSE_TAG
container_name: "${PROJECT_NAME}_docker_compose"
environment:
JENKINS_HOME: $JENKINS_HOME
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./config/jenkins_home:${JENKINS_HOME}
portainer:
image: portainer/portainer:$PORTAINER_TAG
container_name: "${PROJECT_NAME}_portainer"
command: --no-auth -H unix:///var/run/docker.sock
restart: always
ports:
- ${PORTAINER_PORT}:9000
volumes:
- /var/run/docker.sock:/var/run/docker.sock
labels:
- "traefik.http.routers.${PROJECT_NAME}_portainer.rule=Host(`portainer.${PROJECT_BASE_URL}`)"
traefik:
image: traefik:$TRAEFIK_TAG
container_name: "${PROJECT_NAME}_traefik"
command: --api.insecure=true --providers.docker=true
restart: always
ports:
- ${TRAEFIK_PORT}:80
- ${TRAEFIK_DASHBOARD_PORT}:8080
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
default:
name: jenkins_docker_bats_stack