Juni 28, 2022

Integrate Drone with GitHub

Prepare GitHub OAuth Application

Please follow this link to read more about setup GitHub OAuth application for Drone:

GitHub | Drone

Running Drone

Save this code below as docker-compose.yaml. Don't forget to change DRONE_GITHUB_CLIENT_ID, DRONE_GITHUB_CLIENT_SECRET, DRONE_RPC_SECRET, and DRONE_SERVER_HOST. Run docker-compose up -d to run the server.

version: '3.3'
services:
    drone:
        volumes:
            - '/var/lib/drone:/data'
        environment:
            - DRONE_GITHUB_CLIENT_ID=your-id
            - DRONE_GITHUB_CLIENT_SECRET=super-duper-secret
            - DRONE_RPC_SECRET=super-duper-secret
            - DRONE_SERVER_HOST=drone.company.com
            - DRONE_SERVER_PROTO=https
        ports:
            - '80:80'
            - '443:443'
        restart: always
        container_name: drone
        image: 'drone/drone:2'
    runner:
        depends_on:
            - "drone"
        volumes:
            - '/var/run/docker.sock:/var/run/docker.sock'
        environment:
            - DRONE_RPC_PROTO=https
            - DRONE_RPC_HOST=drone
            - DRONE_RPC_SECRET=super-duper-secret
            - DRONE_RUNNER_CAPACITY=2
            - DRONE_RUNNER_NAME=drone-runner
        ports:
            - '3000:3000'
        restart: always
        container_name: runner
        image: 'drone/drone-runner-docker:1'