-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
57 lines (56 loc) · 2.31 KB
/
Copy pathdocker-compose.yml
File metadata and controls
57 lines (56 loc) · 2.31 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
services:
gharp:
# Local source build is the default. Run `docker compose pull` first
# to use the published image instead, or `docker compose up --build`
# to force a rebuild from source.
build: .
image: muhac/gharp:1
container_name: gharp
restart: unless-stopped
env_file: .env
# RUNNER_COMMAND uses YAML `>-` so the multi-line source folds to one
# line at runtime; .env can't hold multi-line values.
environment:
# Concurrent runner cap.
MAX_CONCURRENT_RUNNERS: "4"
# Pin the runner image so reproducibility doesn't depend on
# whatever `latest` resolves to today. ubuntu-noble = 24.04.
RUNNER_IMAGE: "myoung34/github-runner:ubuntu-noble"
RUNNER_WORKDIR_ROOT: /tmp/gharp
# Bearer token for the admin/JSON APIs (dashboard, /jobs, /stats,
# retry/cancel). Read from the host env or .env (see .env.example).
# Empty value = no auth, dashboard fully open. Must be set on any
# internet-reachable deployment.
ADMIN_TOKEN: "${ADMIN_TOKEN:-}"
# Optional: run a periodic maintenance command (e.g. to prune Docker
# storage). Both variables must be set together to enable the feature.
# MAINTENANCE_COMMAND: '["docker","system","prune","-f","--volumes"]'
# MAINTENANCE_INTERVAL: 6h
RUNNER_COMMAND: >-
[
"docker","run","--rm","-d",
"--name","{{.ContainerName}}",
"--network=host",
"--log-opt","max-size=10m",
"--log-opt","max-file=3",
"-v","/var/run/docker.sock:/var/run/docker.sock",
"-v","/tmp/gharp/{{.ContainerName}}/_work:/tmp/gharp/{{.ContainerName}}/_work",
"-e","REPO_URL={{.RepoURL}}",
"-e","RUNNER_TOKEN={{.RegistrationToken}}",
"-e","RUNNER_NAME={{.RunnerName}}",
"-e","LABELS={{.Labels}}",
"-e","RUNNER_WORKDIR=/tmp/gharp/{{.ContainerName}}/_work",
"-e","EPHEMERAL=1",
"{{.Image}}"
]
ports:
- "${PORT:-8080}:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- gharp-data:/data
# Mount the workdir tree at the same path inside the gharp container
# and on the host, so `-v /tmp/gharp/...` sources in RUNNER_COMMAND
# resolve identically from both views.
- /tmp/gharp:/tmp/gharp
volumes:
gharp-data: