2021-04-20 15:52:30 +02:00
|
|
|
version: '2.4'
|
|
|
|
|
|
|
|
services:
|
|
|
|
# The main drone instance
|
|
|
|
app:
|
|
|
|
# Latest version as of writing this document
|
|
|
|
image: 'laszlocloud/woodpecker-server:v0.12.0'
|
|
|
|
restart: 'always'
|
|
|
|
|
|
|
|
depends_on:
|
|
|
|
db:
|
|
|
|
condition: 'service_healthy'
|
|
|
|
healthcheck:
|
|
|
|
test: 'curl -f http://localhost:8000/ || exit 1'
|
|
|
|
interval: '30s'
|
|
|
|
retries: 3
|
|
|
|
timeout: '5s'
|
|
|
|
start_period: '10s'
|
|
|
|
|
2021-04-23 23:35:30 +02:00
|
|
|
env_file:
|
|
|
|
- '.env'
|
2021-04-20 15:52:30 +02:00
|
|
|
networks:
|
|
|
|
- 'default'
|
|
|
|
- 'nginx'
|
|
|
|
ports:
|
|
|
|
# Used to communicate with the agents (I think)
|
|
|
|
- '9000:9000'
|
|
|
|
volumes:
|
|
|
|
- 'server-data:/var/lib/drone'
|
|
|
|
|
|
|
|
# Database for the server
|
|
|
|
db:
|
|
|
|
image: 'postgres:13.2-alpine'
|
|
|
|
restart: 'always'
|
|
|
|
|
|
|
|
healthcheck:
|
|
|
|
test: 'pg_isready -U woodpecker'
|
|
|
|
interval: '30s'
|
|
|
|
timeout: '5s'
|
|
|
|
retries: 3
|
|
|
|
start_period: '0s'
|
|
|
|
|
|
|
|
environment:
|
|
|
|
- 'POSTGRES_DB=woodpecker'
|
|
|
|
- 'POSTGRES_USER=woodpecker'
|
|
|
|
- 'POSTGRES_PASSWORD=woodpecker'
|
|
|
|
volumes:
|
|
|
|
- 'db-data:/var/lib/postgresql/data'
|
|
|
|
|
|
|
|
# We can deploy more agents by using the scale command
|
|
|
|
# Each agent can do one parallel build by default
|
|
|
|
agent:
|
|
|
|
image: 'laszlocloud/woodpecker-server:v0.12.0'
|
|
|
|
restart: 'always'
|
|
|
|
command: 'agent'
|
|
|
|
|
|
|
|
depends_on:
|
2021-04-23 23:35:30 +02:00
|
|
|
app:
|
|
|
|
condition: 'service_healthy'
|
2021-04-20 15:52:30 +02:00
|
|
|
|
|
|
|
environment:
|
|
|
|
- 'DRONE_SERVER=${DRONE_HOST}'
|
|
|
|
- 'DRONE_SECRET=${DRONE_SECRET}'
|
|
|
|
volumes:
|
|
|
|
- '/var/run/docker.sock:/var/run/docker.sock'
|
|
|
|
|
2021-04-23 23:53:01 +02:00
|
|
|
networks:
|
|
|
|
nginx:
|
|
|
|
external: true
|
|
|
|
|
2021-04-20 15:52:30 +02:00
|
|
|
volumes:
|
|
|
|
db-data:
|
|
|
|
server-data:
|