Add docs about Gitea on same host and update docker-compose example (#2752)

Closes #1660

Taken out the part of it that's still up-to-date.
Everything else in this PR is outdated as we don't primarily use quay.io

---------

Co-authored-by: Anbraten <anton@ju60.de>
Co-authored-by: Patrick Schratz <patrick.schratz@gmail.com>
This commit is contained in:
qwerty287 2023-11-11 12:38:21 +01:00 committed by GitHub
parent e6b3b94241
commit f2ed2e7b48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 8 deletions

View file

@ -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:

View file

@ -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.<host>/user/settings/`. It is very import the authorization callback URL matches your http(s) scheme and hostname exactly with `https://<host>/authorize` as the path.