2024-04-07 15:53:48 +01:00
|
|
|
# Copyright 2024 The Forgejo Authors.
|
2023-08-24 11:28:17 +01:00
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
2023-09-04 17:19:15 +01:00
|
|
|
#
|
|
|
|
# Create a secret with:
|
|
|
|
#
|
|
|
|
# openssl rand -hex 20
|
|
|
|
#
|
|
|
|
# Replace all occurences of {SHARED_SECRET} below with the output.
|
|
|
|
#
|
|
|
|
# NOTE: a token obtained from the Forgejo web interface cannot be used
|
|
|
|
# as a shared secret.
|
|
|
|
#
|
2024-09-25 22:05:56 +01:00
|
|
|
# Replace {RUNNER_TOKEN} with the token obtained from the Forgejo web interface.
|
2023-09-04 17:19:15 +01:00
|
|
|
#
|
|
|
|
|
2024-09-25 22:05:56 +01:00
|
|
|
networks:
|
|
|
|
forgejo:
|
|
|
|
|
2024-04-07 17:07:00 +01:00
|
|
|
volumes:
|
|
|
|
docker_certs:
|
2023-08-24 11:28:17 +01:00
|
|
|
|
|
|
|
services:
|
|
|
|
docker-in-docker:
|
2024-08-13 13:00:37 +01:00
|
|
|
image: code.forgejo.org/oci/docker:dind
|
2024-09-25 22:05:56 +01:00
|
|
|
container_name: docker # needed for docker internal DNS resolution
|
2024-04-07 17:07:00 +01:00
|
|
|
hostname: docker # Must set hostname as TLS certificates are only valid for docker or localhost
|
2024-08-13 07:37:52 +01:00
|
|
|
privileged: true
|
2024-09-25 22:05:56 +01:00
|
|
|
networks:
|
|
|
|
- forgejo
|
2024-04-07 17:07:00 +01:00
|
|
|
environment:
|
|
|
|
DOCKER_TLS_CERTDIR: /certs
|
|
|
|
DOCKER_HOST: docker-in-docker
|
|
|
|
volumes:
|
|
|
|
- docker_certs:/certs
|
2023-08-24 11:28:17 +01:00
|
|
|
|
|
|
|
forgejo:
|
2023-12-04 20:33:21 +00:00
|
|
|
image: codeberg.org/forgejo/forgejo:1.21
|
2024-09-25 22:05:56 +01:00
|
|
|
container_name: forgejo
|
|
|
|
networks:
|
|
|
|
- forgejo
|
2023-08-24 11:28:17 +01:00
|
|
|
volumes:
|
2024-09-25 22:05:56 +01:00
|
|
|
- ./forgejo:/data
|
2023-08-24 11:28:17 +01:00
|
|
|
ports:
|
|
|
|
- 8080:3000
|
|
|
|
|
2024-09-25 22:05:56 +01:00
|
|
|
forgejo-runner:
|
|
|
|
## TODO: Update image to the the release
|
|
|
|
## made from this PR: https://code.forgejo.org/forgejo/runner/pulls/283
|
|
|
|
|
|
|
|
# image: code.forgejo.org/forgejo/runner:3.4.1
|
|
|
|
build: ../../
|
|
|
|
container_name: forgejo-runner
|
2023-08-24 11:28:17 +01:00
|
|
|
volumes:
|
2024-09-25 22:05:56 +01:00
|
|
|
- ./forgejo-runner:/data
|
|
|
|
- docker_certs:/certs
|
|
|
|
networks:
|
|
|
|
- forgejo
|
|
|
|
depends_on:
|
2023-08-24 11:28:17 +01:00
|
|
|
- docker-in-docker
|
|
|
|
- forgejo
|
|
|
|
environment:
|
2024-09-25 22:05:56 +01:00
|
|
|
CONFIG_FILE: config.yml # defaults to /data/config.yml
|
|
|
|
|
|
|
|
FORGEJO_URL: ${FORGEJO_URL} # defaults to http://forgejo:3000
|
|
|
|
|
|
|
|
RUNNER_FILE: runner.json # defaults to /data/runner.json
|
|
|
|
RUNNER_NAME: forgejo-runner # defaults to forgejo-runner, used for registration
|
|
|
|
RUNNER_TOKEN: "{RUNNER_TOKEN}"
|
|
|
|
RUNNER_USER: 1000 # defaults to 1000
|