From bef0a4bc8125abfd6580bee70a0e5b323e0cc186 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sun, 5 Jan 2025 21:35:02 +0000 Subject: [PATCH] Ensure the forgejo runner cache is accessible to jobs --- ansible/roles/forgejo_runner/files/config.yml | 4 ++-- ansible/roles/forgejo_runner/files/docker-compose.yml | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ansible/roles/forgejo_runner/files/config.yml b/ansible/roles/forgejo_runner/files/config.yml index 668e81b..d8d3d5e 100644 --- a/ansible/roles/forgejo_runner/files/config.yml +++ b/ansible/roles/forgejo_runner/files/config.yml @@ -39,10 +39,10 @@ cache: # The host of the cache server. # It's not for the address to listen, but the address to connect from job containers. # So 0.0.0.0 is a bad choice, leave it empty to detect automatically. - host: "" + host: "{{ ansible_default_ipv4.address }}" # The port of the cache server. # 0 means to use a random available port. - port: 0 + port: 4000 # The external cache server URL. Valid only when enable is true. # If it's specified, act_runner will use this URL as the ACTIONS_CACHE_URL rather than start a server by itself. # The URL should generally end with "/". diff --git a/ansible/roles/forgejo_runner/files/docker-compose.yml b/ansible/roles/forgejo_runner/files/docker-compose.yml index 64a0e4b..86f41d0 100644 --- a/ansible/roles/forgejo_runner/files/docker-compose.yml +++ b/ansible/roles/forgejo_runner/files/docker-compose.yml @@ -9,12 +9,14 @@ services: - TZ={{ timezone }} - DOCKER_HOST=tcp://docker_proxy:2375 restart: unless-stopped - command: forgejo-runner daemon + command: forgejo-runner --config config.yml daemon networks: - default - forgejo_private depends_on: - docker_proxy + ports: + - "{{ ansible_default_ipv4.address }}:4000:4000" docker_proxy: image: lscr.io/linuxserver/socket-proxy:latest