deploy_gitea_runner/templates/docker-compose.yml.j2

52 lines
1.4 KiB
Plaintext
Raw Normal View History

2023-07-27 13:11:38 +00:00
---
version: '3.9'
services:
runner:
image: gitea/act_runner:{{ deploy_gitea_runner_version }}
2023-07-27 13:11:38 +00:00
configs:
- source: config_yaml
target: /config.yaml
environment:
CONFIG_FILE: /config.yaml
2023-07-27 17:12:18 +00:00
GITEA_INSTANCE_URL: "{{ deploy_gitea_runner_server_url }}"
GITEA_RUNNER_REGISTRATION_TOKEN: "{{ deploy_gitea_runner_server_token }}"
GITEA_RUNNER_NAME: "{{ deploy_gitea_runner_name }}"
2023-07-27 13:11:38 +00:00
volumes:
- data:/data
2023-07-27 17:12:18 +00:00
{% if deploy_gitea_runner_config['cache']['enabled'] is defined and deploy_gitea_runner_config['cache']['enabled'] %}
2023-07-27 13:11:38 +00:00
- cache:/cache
2023-07-27 17:12:18 +00:00
{%- endif %}
2023-07-27 13:11:38 +00:00
- /var/run/docker.sock:/var/run/docker.sock
2023-07-27 17:12:18 +00:00
{% if deploy_gitea_runner_config['cache']['port'] is defined %}
2023-07-27 13:11:38 +00:00
ports:
2023-07-27 17:12:18 +00:00
- target: {{ deploy_gitea_runner_config['cache']['port'] }}
published: {{ deploy_gitea_runner_config['cache']['port'] }}
2023-07-27 13:11:38 +00:00
protocol: tcp
mode: ingress
2023-07-27 17:12:18 +00:00
{%- endif %}
2023-07-27 13:11:38 +00:00
networks:
- internal
networks:
internal:
driver: bridge
volumes:
data:
driver_opts:
o: bind
2023-07-27 17:12:18 +00:00
device: {{ deploy_gitea_runner_directory }}/data
2023-07-27 13:11:38 +00:00
type: none
2023-07-27 17:12:18 +00:00
{% if deploy_gitea_runner_config['cache']['enabled'] is defined and deploy_gitea_runner_config['cache']['enabled'] %}
2023-07-27 13:11:38 +00:00
cache:
driver_opts:
o: bind
2023-07-27 17:12:18 +00:00
device: {{ deploy_gitea_runner_directory }}/cache
2023-07-27 13:11:38 +00:00
type: none
2023-07-27 17:12:18 +00:00
{%- endif %}
2023-07-27 13:11:38 +00:00
configs:
config_yaml:
2023-07-27 17:12:18 +00:00
file: {{ deploy_gitea_runner_directory }}/config.yaml