version : '3'
services:
  drone-server:
    container_name: drone-server
    restart: always
    image: drone/drone:2
    ports:
      - "3080:80"
    volumes:
      - ./data:/data
    environment:
      - TZ=Asia/Shanghai
      - DRONE_AGENTS_ENABLED=true
      - DRONE_GOGS_SERVER=http://192.168.217.1:13000
      - DRONE_RPC_SECRET=ping-secret
      - DRONE_SERVER_HOST=192.168.217.1:3080
      - DRONE_SERVER_PROTO=http
      - DRONE_USER_CREATE=username:ping,admin:true

  drone-runner-docker:
    container_name: drone-runner-docker
    image: drone/drone-runner-docker:1
    ports:
      - "3000:3000"
    restart: always
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - DRONE_RPC_PROTO=http
      - DRONE_RPC_HOST=192.168.217.1:3080
      - DRONE_RPC_SECRET=ping
      - DRONE_RUNNER_CAPACITY=2
      - DRONE_RUNNER_NAME=my-first-runner
      - TZ=Asia/Shanghai