deployment/stacks/woodpecker.yml

100 lines
2.4 KiB
YAML
Raw Normal View History

2021-12-29 20:19:55 +01:00
version: '3.4'
services:
app:
2022-01-03 13:59:24 +01:00
image: 'woodpeckerci/woodpecker-server:next'
2021-12-29 20:19:55 +01:00
deploy:
mode: 'replicated'
replicas: 1
placement:
constraints:
- 'node.labels.class==admin'
labels:
- 'traefik.enable=true'
2021-12-29 20:50:20 +01:00
- 'traefik.http.routers.woodpecker.rule=Host(`ci.rustybever.be`)'
- 'traefik.http.routers.woodpecker.tls=true'
- 'traefik.http.routers.woodpecker.tls.certresolver=letsEncrypt'
- 'traefik.http.services.woodpecker.loadbalancer.server.port=8000'
2021-12-29 20:19:55 +01:00
environment:
- 'WOODPECKER_OPEN=true'
2021-12-29 22:19:40 +01:00
- 'WOODPECKER_ADMIN=Chewing_Bever'
2021-12-29 20:48:32 +01:00
- 'WOODPECKER_HOST=https://ci.rustybever.be'
2021-12-29 20:19:55 +01:00
- 'WOODPECKER_DATABASE_DRIVER=postgres'
2021-12-29 22:16:39 +01:00
- 'WOODPECKER_DATABASE_DATASOURCE=postgres://woodpecker:woodpecker@db:5432/woodpecker?sslmode=disable'
2021-12-29 22:53:53 +01:00
- 'WOODPECKER_AGENT_SECRET=${WOODPECKER_AGENT_SECRET}'
2021-12-29 20:19:55 +01:00
- 'WOODPECKER_GITEA=true'
- 'WOODPECKER_GITEA_URL=https://git.rustybever.be'
2021-12-29 22:53:53 +01:00
- 'WOODPECKER_GITEA_CLIENT=${WOODPECKER_GITEA_CLIENT}'
- 'WOODPECKER_GITEA_SECRET=${WOODPECKER_GITEA_SECRET}'
2021-12-29 20:47:38 +01:00
networks:
- default
- public
2022-01-14 19:45:52 +01:00
ports:
# Used for external agents to connect
- 9000:9000
2021-12-29 20:19:55 +01:00
db:
2022-04-23 11:55:27 +02:00
image: 'postgres:14.2-alpine'
2021-12-29 20:19:55 +01:00
deploy:
mode: 'replicated'
replicas: 1
placement:
constraints:
- 'node.labels.class==admin'
healthcheck:
2021-12-29 22:16:39 +01:00
test: pg_isready -U woodpecker -d woodpecker
2021-12-29 20:19:55 +01:00
interval: 30s
timeout: 5s
retries: 3
start_period: 15s
environment:
2021-12-29 22:16:39 +01:00
- 'POSTGRES_USER=woodpecker'
2021-12-29 20:19:55 +01:00
- 'POSTGRES_PASSWORD=woodpecker'
- 'POSTGRES_DB=woodpecker'
volumes:
- 'db-data:/var/lib/postgresql/data'
2022-01-13 14:29:23 +01:00
agent-1:
2022-04-23 11:55:27 +02:00
image: 'woodpeckerci/woodpecker-agent:next'
2021-12-29 20:19:55 +01:00
command: agent
deploy:
mode: 'global'
placement:
constraints:
2022-01-13 14:29:23 +01:00
- 'node.hostname==gamma'
environment:
- 'WOODPECKER_SERVER=app:9000'
- 'WOODPECKER_AGENT_SECRET=${WOODPECKER_AGENT_SECRET}'
volumes:
- /var/run/docker.sock:/var/run/docker.sock
agent-2:
2022-04-23 11:55:27 +02:00
image: 'woodpeckerci/woodpecker-agent:next'
2022-01-13 14:29:23 +01:00
command: agent
deploy:
mode: 'global'
placement:
constraints:
- 'node.hostname==alpha'
2021-12-29 20:19:55 +01:00
environment:
2021-12-29 22:53:53 +01:00
- 'WOODPECKER_SERVER=app:9000'
- 'WOODPECKER_AGENT_SECRET=${WOODPECKER_AGENT_SECRET}'
2021-12-29 20:19:55 +01:00
volumes:
- /var/run/docker.sock:/var/run/docker.sock
2021-12-29 20:47:38 +01:00
networks:
public:
external: true
2021-12-29 20:19:55 +01:00
volumes:
db-data: