basic setup
This commit is contained in:
parent
d3350339ba
commit
4115774d98
63
compose.yml
63
compose.yml
@ -1,35 +1,52 @@
|
|||||||
---
|
---
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
image: nginx:1.27.5
|
image: data.forgejo.org/forgejo/runner:4.0.0
|
||||||
networks:
|
networks:
|
||||||
- proxy
|
- internal
|
||||||
|
environment:
|
||||||
|
DOCKER_HOST: tcp://dind:2375
|
||||||
deploy:
|
deploy:
|
||||||
restart_policy:
|
restart_policy:
|
||||||
condition: on-failure
|
condition: on-failure
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
|
||||||
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=80"
|
|
||||||
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})"
|
|
||||||
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
|
|
||||||
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
|
|
||||||
## Redirect from EXTRA_DOMAINS to DOMAIN
|
|
||||||
#- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect"
|
|
||||||
## Redirect HTTP to HTTPS
|
|
||||||
# - "traefik.http.middlewares.${STACK_NAME}-redirect.redirectscheme.scheme=https"
|
|
||||||
# - "traefik.http.middlewares.${STACK_NAME}-redirect.redirectscheme.permanent=true"
|
|
||||||
## When you're ready for release, run "abra recipe sync <name>" to set this
|
|
||||||
- "coop-cloud.${STACK_NAME}.version="
|
- "coop-cloud.${STACK_NAME}.version="
|
||||||
## Enable backups: https://docs.coopcloud.tech/maintainers/handbook/#how-do-i-configure-backuprestore
|
entrypoint: /custom-entrypoint.sh
|
||||||
# - "backupbot.backup=true"
|
configs:
|
||||||
# - "backupbot.backup.path=/some/path"
|
- source: entrypoint
|
||||||
healthcheck:
|
target: /custom-entrypoint.sh
|
||||||
test: ["CMD", "curl", "-f", "http://localhost"]
|
mode: 0555
|
||||||
interval: 30s
|
volumes:
|
||||||
timeout: 10s
|
- data:/data
|
||||||
retries: 10
|
secrets:
|
||||||
start_period: 1m
|
- act_runner_instance
|
||||||
|
- act_runner_token
|
||||||
|
|
||||||
|
dind:
|
||||||
|
image: docker:dind
|
||||||
|
privileged: 'true'
|
||||||
|
command: ['dockerd', '-H', 'tcp://0.0.0.0:2375', '--tls=false']
|
||||||
|
deploy:
|
||||||
|
restart_policy:
|
||||||
|
condition: on-failure
|
||||||
|
networks:
|
||||||
|
- internal
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
proxy:
|
internal:
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
data:
|
||||||
|
|
||||||
|
secrets:
|
||||||
|
act_runner_instance:
|
||||||
external: true
|
external: true
|
||||||
|
name: ${STACK_NAME}_act_runner_instance_${SECRET_ACT_RUNNER_INSTANCE_VERSION}
|
||||||
|
act_runner_token:
|
||||||
|
external: true
|
||||||
|
name: ${STACK_NAME}_act_runner_token_${SECRET_ACT_RUNNER_TOKEN_VERSION}
|
||||||
|
|
||||||
|
configs:
|
||||||
|
entrypoint:
|
||||||
|
name: ${STACK_NAME}_entrypoint_${ENTRYPOINT_VERSION}
|
||||||
|
file: entrypoint.sh
|
||||||
|
17
entrypoint.sh
Normal file
17
entrypoint.sh
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Read instance and token from Docker secrets
|
||||||
|
INSTANCE=$(cat /run/secrets/act_runner_instance)
|
||||||
|
TOKEN=$(cat /run/secrets/act_runner_token)
|
||||||
|
|
||||||
|
# Check if .runner file exists
|
||||||
|
if [ ! -f .runner ]; then
|
||||||
|
echo "No .runner file exists. Running registration..."
|
||||||
|
forgejo-runner register --instance "${INSTANCE}" --token "${TOKEN}" --no-interactive
|
||||||
|
else
|
||||||
|
echo ".runner file exists. Skipping registration."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Run forgejo-runner daemon
|
||||||
|
exec forgejo-runner daemon
|
Loading…
x
Reference in New Issue
Block a user