😣出了点问题,继续维护runner的compose文件
This commit is contained in:
parent
7a46eb7e63
commit
05a409d709
|
|
@ -1,3 +1,5 @@
|
|||
version: "3.9"
|
||||
|
||||
services:
|
||||
forgejo_runner:
|
||||
image: code.forgejo.org/forgejo/runner:7.0.0
|
||||
|
|
@ -5,19 +7,30 @@ services:
|
|||
restart: always
|
||||
networks:
|
||||
- 1panel-network
|
||||
command: >-
|
||||
bash -c '
|
||||
if [ ! -f /data/.runner ]; then
|
||||
forgejo-runner create-runner-file --connect \
|
||||
--instance ${FORGEJO_INSTANCE_URL} \
|
||||
--name ${RUNNER_NAME} \
|
||||
--secret ${RUNNER_SHARED_SECRET} ;
|
||||
sed -i -e "s|\"labels\": null|\"labels\": [\"${RUNNER_LABELS}\"]|" /data/.runner ;
|
||||
forgejo-runner generate-config --config /data/config.yml ;
|
||||
sed -i -e "s| level: info| level: debug|" /data/config.yml ;
|
||||
fi ;
|
||||
forgejo-runner --config /data/config.yml daemon
|
||||
'
|
||||
volumes:
|
||||
#- ./data/config.yaml:/config.yaml # 可选配置
|
||||
- ./data/data:/data
|
||||
- ./data:/data
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
environment:
|
||||
#- CONFIG_FILE=/config.yaml
|
||||
- FORGEJO_INSTANCE_URL=${FORGEJO_INSTANCE_URL}
|
||||
- FORGEJO_RUNNER_REGISTRATION_TOKEN=${RUNNER_REGISTRATION_TOKEN}
|
||||
- FORGEJO_RUNNER_NAME=${RUNNER_NAME}
|
||||
- FORGEJO_RUNNER_LABELS=${RUNNER_LABELS}
|
||||
- RUNNER_NAME=${RUNNER_NAME}
|
||||
- RUNNER_LABELS=${RUNNER_LABELS}
|
||||
- RUNNER_SHARED_SECRET=${RUNNER_SHARED_SECRET}
|
||||
labels:
|
||||
createdBy: "Apps"
|
||||
|
||||
networks:
|
||||
networks:
|
||||
1panel-network:
|
||||
external: true
|
||||
|
|
|
|||
Loading…
Reference in New Issue