update entrypoint and dockerfile, fix test workflow

update dockerfile,

rework entrypoint execution,

update compose and test
This commit is contained in:
Merith 2024-09-25 15:21:53 -07:00
parent 3c5ba1c1d2
commit c1654806c5
5 changed files with 112 additions and 40 deletions

View file

@ -11,7 +11,7 @@
# NOTE: a token obtained from the Forgejo web interface cannot be used
# as a shared secret.
#
# Replace {RUNNER_TOKEN} with the token obtained from the Forgejo web interface.
# Replace ${RUNNER_TOKEN} with the token obtained from the Forgejo web interface.
#
networks:
@ -43,14 +43,24 @@ services:
- ./forgejo:/data
ports:
- 8080:3000
command: >-
bash -c '
/bin/s6-svscan /etc/s6 &
sleep 10 ;
su -c "forgejo forgejo-cli actions register --secret {SHARED_SECRET}" git ;
sleep infinity
'
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: ../../
build:
context: ../../
dockerfile: Dockerfile
container_name: forgejo-runner
# user: "1000" # set to run rootless, overrides RUNNER_USER
volumes:
- ./forgejo-runner:/data
- docker_certs:/certs
@ -63,8 +73,36 @@ services:
CONFIG_FILE: config.yml # defaults to /data/config.yml
FORGEJO_URL: ${FORGEJO_URL} # defaults to http://forgejo:3000
FORGEJO_SECRET: "{SHARED_SECRET}" # shared secret, must match Forgejo's
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_TOKEN: "${RUNNER_TOKEN}"
RUNNER_USER: 1000 # defaults to 1000
forgejo-runner-rootless:
## 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:
context: ../../
dockerfile: Dockerfile.rootless
container_name: forgejo-runner-rootless
volumes:
- ./forgejo-runner:/data
- docker_certs:/certs
networks:
- forgejo
depends_on:
- docker-in-docker
- forgejo
environment:
CONFIG_FILE: config-rootless.yml # defaults to /data/config.yml
FORGEJO_URL: ${FORGEJO_URL} # defaults to http://forgejo:3000
FORGEJO_SECRET: "{SHARED_SECRET}" # shared secret, must match Forgejo's
RUNNER_FILE: runner-rootless.json # defaults to /data/runner.json
RUNNER_NAME: forgejo-runner # defaults to forgejo-runner, used for registration
RUNNER_TOKEN: "${RUNNER_TOKEN}"