deployment/stacks/woodpecker.yml

94 lines
2.3 KiB
YAML
Raw Normal View History

2021-12-29 20:19:55 +01:00
version: '3.4'
services:
app:
image: 'woodpeckerci/woodpecker-server:latest'
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 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:13:00 +01:00
- 'WOODPECKER_DATABASE_DATASOURCE=postgres://root:woodpecker@db:5432/woodpecker?sslmode=disable'
2021-12-29 20:19:55 +01:00
- 'WOODPECKER_AGENT_SECRET_FILE=/run/secrets/woodpecker_agent_secret'
- 'WOODPECKER_GITEA=true'
- 'WOODPECKER_GITEA_URL=https://git.rustybever.be'
2021-12-29 21:49:32 +01:00
- 'WOODPECKER_GITEA_CLIENT_FILE=/run/secrets/woodpecker_gitea_client_v2'
2021-12-29 20:19:55 +01:00
- 'WOODPECKER_GITEA_SECRET_FILE=/run/secrets/woodpecker_gitea_secret'
2021-12-29 20:47:38 +01:00
networks:
- default
- public
2021-12-29 20:19:55 +01:00
secrets:
- woodpecker_agent_secret
2021-12-29 21:13:11 +01:00
- woodpecker_gitea_client_v2
2021-12-29 20:19:55 +01:00
- woodpecker_gitea_secret
db:
image: 'postgres:14.1-alpine'
deploy:
mode: 'replicated'
replicas: 1
placement:
constraints:
- 'node.labels.class==admin'
healthcheck:
test: pg_isready
interval: 30s
timeout: 5s
retries: 3
start_period: 15s
environment:
2021-12-29 22:13:22 +01:00
- 'POSTGRES_USER=root'
2021-12-29 20:19:55 +01:00
- 'POSTGRES_PASSWORD=woodpecker'
- 'POSTGRES_DB=woodpecker'
volumes:
- 'db-data:/var/lib/postgresql/data'
agent:
image: 'woodpeckerci/woodpecker-agent:latest'
command: agent
deploy:
mode: 'global'
placement:
constraints:
- 'node.labels.class.ci==true'
environment:
- WOODPECKER_SERVER=app:9000
- WOODPECKER_AGENT_SECRET_FILE=/run/secrets/woodpecker_agent_secret
secrets:
- woodpecker_agent_secret
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
secrets:
woodpecker_agent_secret:
external: true
2021-12-29 21:13:11 +01:00
woodpecker_gitea_client_v2:
2021-12-29 20:19:55 +01:00
external: true
woodpecker_gitea_secret:
external: true
volumes:
db-data: