diff --git a/README.md b/README.md index 9e84b2a..0e1a263 100644 --- a/README.md +++ b/README.md @@ -91,5 +91,29 @@ You can specify the configuration file path with `-c`/`--config` argument. ### Run a docker container ```sh -docker run -e GITEA_INSTANCE_URL=http://192.168.8.18:3000 -e GITEA_RUNNER_REGISTRATION_TOKEN= -v /var/run/docker.sock:/var/run/docker.sock --name my_runner gitea/act_runner:nightly +docker run -e GITEA_INSTANCE_URL=http://192.168.8.18:3000 -e GITEA_RUNNER_REGISTRATION_TOKEN= -v /var/run/docker.sock:/var/run/docker.sock -v $PWD/data:/data --name my_runner gitea/act_runner:nightly +``` + +The `/data` directory inside the docker container contains the runner API keys after registration. +It must be persisted, otherwise the runner would try to register again, using the same, now defunct registration token. + +### Running in docker-compose + +```yml +... + gitea: + image: gitea/gitea + ... + + runner: + image: gitea/act_runner + restart: always + depends_on: + - gitea + volumes: + - ./data/act_runner:/data + - /var/run/docker.sock:/var/run/docker.sock + environment: + - GITEA_INSTANCE_URL= + - GITEA_RUNNER_REGISTRATION_TOKEN= ```