diff --git a/docker-compose.example.yml b/docker-compose.example.yml index bfc2fade5..6ce862d79 100644 --- a/docker-compose.example.yml +++ b/docker-compose.example.yml @@ -2,12 +2,11 @@ version: '3' services: woodpecker-server: - build: - context: . - dockerfile: Dockerfile - image: woodpeckerci/woodpecker-server:local + image: woodpeckerci/woodpecker-server:latest ports: - 8000:8000 + networks: + - woodpecker volumes: - /var/lib/woodpecker:/var/lib/woodpecker/ environment: @@ -19,13 +18,18 @@ services: - WOODPECKER_GITHUB_SECRET=${WOODPECKER_GITHUB_SECRET} - WOODPECKER_AGENT_SECRET=${WOODPECKER_AGENT_SECRET} woodpecker-agent: - build: - context: . - dockerfile: Dockerfile.agent - image: woodpeckerci/woodpecker-agent:local + depends_on: + woodpecker-server: + condition: service_healthy + image: woodpeckerci/woodpecker-agent:latest + networks: + - woodpecker volumes: - /var/run/docker.sock:/var/run/docker.sock environment: - WOODPECKER_SERVER=woodpecker-server:9000 - WOODPECKER_AGENT_SECRET=${WOODPECKER_AGENT_SECRET} - WOODPECKER_MAX_WORKFLOWS=2 + +networks: + woodpecker: diff --git a/docs/docs/30-administration/11-forges/30-gitea.md b/docs/docs/30-administration/11-forges/30-gitea.md index 54e94a651..b4d7f4e03 100644 --- a/docs/docs/30-administration/11-forges/30-gitea.md +++ b/docs/docs/30-administration/11-forges/30-gitea.md @@ -20,6 +20,27 @@ services: [...] ``` +## Gitea on the same host + +If you have Gitea also running on the same host within a container, make sure the agent does have access to it. +The agent tries to clone using the URL which Gitea reports through its API. For simplified connectivity, you should add the woodpecker agent to the same docker network as Gitea is in. +Otherwise, the communication should go via the `docker0` gateway (usually 172.17.0.1). + +To configure the Docker network if the network's name is `gitea`, configure it like this: + +```diff +# docker-compose.yml +version: '3' + +services: + [...] + woodpecker-agent: + [...] + environment: + - [...] ++ - WOODPECKER_BACKEND_DOCKER_NETWORK=gitea +``` + ## Registration Register your application with Gitea to create your client id and secret. You can find the OAuth applications settings of Gitea at `https://gitea./user/settings/`. It is very import the authorization callback URL matches your http(s) scheme and hostname exactly with `https:///authorize` as the path.