-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
63 lines (58 loc) · 2.02 KB
/
docker-compose.yaml
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
version: '3'
services:
docker:
image: docker:24-dind
command: dockerd --host=unix:///var/run/docker.sock --tls=false --host=tcp://0.0.0.0:2376
# Privileged mode is required for DinD.
privileged: true
networks:
- runner-network
restart: unless-stopped
healthcheck:
test: ["CMD", "docker", "ps"]
interval: 3s
volumes:
- docker-data:/var/lib/docker
# Remove the labels to disable auto updates
labels:
- com.centurylinklabs.watchtower.scope=actions-runner
worker:
# You can change the tag for runner image
image: myoung34/github-runner:latest
env_file: .env
networks:
- runner-network
restart: unless-stopped
depends_on:
docker:
condition: service_healthy
# Don't change these environment var, it is required for runner container to communicate with Docker daemon
environment:
- DOCKER_HOST=tcp://docker:2376
# Remove the labels to disable auto updates
labels:
- com.centurylinklabs.watchtower.scope=actions-runner
# Change the number replicas as you liked, please use EPHEMERAL option in .env if you do this.
deploy:
replicas: 8
watchtower:
image: containrrr/watchtower:latest
command: --cleanup --scope actions-runner --schedule "30 0 0 * * *"
networks:
- runner-network
restart: unless-stopped
volumes:
# Needed because watchtower needs to manage containers from host's daemon.
- /var/run/docker.sock:/var/run/docker.sock
# Sync timezone with host
- /etc/localtime:/etc/localtime:ro
# This is used to make watchtower uses authenticated request for Docker Hub to prevent limitations
# You can remove this, create your own config, or use your own way for authenticated request
# To create your own config.json, follow: https://sh.hzmi.xyz/watchtowerauthconfig
- $HOME/.docker/config.json:/config.json:ro
labels:
- com.centurylinklabs.watchtower.scope=actions-runner
networks:
runner-network:
volumes:
docker-data: