68 lines
1.6 KiB
YAML
68 lines
1.6 KiB
YAML
version: '2.4'
|
|
|
|
services:
|
|
# The main drone instance
|
|
app:
|
|
# Latest version as of writing this document
|
|
image: 'laszlocloud/woodpecker-server:v0.13.0'
|
|
restart: 'always'
|
|
|
|
depends_on:
|
|
db:
|
|
condition: 'service_healthy'
|
|
|
|
env_file:
|
|
- '.env'
|
|
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-agent:v0.13.0'
|
|
restart: 'always'
|
|
command: 'agent'
|
|
|
|
depends_on:
|
|
app:
|
|
condition: 'service_healthy'
|
|
|
|
environment:
|
|
- 'DRONE_SERVER=${DRONE_SERVER}'
|
|
- 'DRONE_SECRET=${DRONE_SECRET}'
|
|
volumes:
|
|
- '/var/run/docker.sock:/var/run/docker.sock'
|
|
|
|
networks:
|
|
nginx:
|
|
external: true
|
|
|
|
volumes:
|
|
db-data:
|
|
server-data:
|