-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
57 lines (54 loc) · 1.86 KB
/
docker-compose.yml
File metadata and controls
57 lines (54 loc) · 1.86 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
version: '3.8'
services:
# Organization Runner 1 - Primary
github-runner-1:
build: .
container_name: github-runner-1
environment:
GITHUB_URL: "${GITHUB_URL}"
GITHUB_TOKEN: "${GITHUB_ORG_TOKEN}"
RUNNER_NAME: "docker-org-runner-1"
RUNNER_LABELS: "${RUNNER_LABELS},primary"
RUNNER_WORKDIR: "_work"
volumes:
# Docker socket for running Docker commands on host (most efficient)
- /var/run/docker.sock:/var/run/docker.sock
# Share Docker daemon config for registry access
- /home/$USER/.docker/config.json:/home/runner/.docker/config.json:ro
# Persistent work directory
- ./runner-work-1:/home/runner/actions-runner/_work
restart: unless-stopped
# Resource limits from .env
deploy:
resources:
limits:
memory: "${MEMORY_LIMIT:-2G}"
cpus: "${CPU_LIMIT:-2.0}"
# Add runner to docker group for proper permissions
group_add:
- ${DOCKER_GID:-999}
# Organization Runner 2 - Secondary
# github-runner-2:
# build: .
# container_name: github-runner-2
# environment:
# GITHUB_URL: "${GITHUB_URL}"
# GITHUB_TOKEN: "${GITHUB_ORG_TOKEN}"
# RUNNER_NAME: "docker-org-runner-2"
# RUNNER_LABELS: "${RUNNER_LABELS},secondary"
# RUNNER_WORKDIR: "_work"
# volumes:
# - /var/run/docker.sock:/var/run/docker.sock
# - /home/$USER/.docker/config.json:/home/runner/.docker/config.json:ro
# - ./runner-work-2:/home/runner/actions-runner/_work
# restart: unless-stopped
# deploy:
# resources:
# limits:
# memory: "${MEMORY_LIMIT:-2G}"
# cpus: "${CPU_LIMIT:-2.0}"
# group_add:
# - ${DOCKER_GID:-999}
# Optional: If you want to easily change the number of runners
# You can use: docker-compose up --scale github-runner-1=3
# But for organization runners, 2 is usually optimal