version: "3.6"
services:
  gitlab-runner:
    image: gitlab/gitlab-runner:alpine
    deploy:
      placement:
        constraints:
          - node.role == worker
      mode: global
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - runner:/etc/gitlab-runner

volumes:
  runner:
    name: runner
    driver_opts:
      type: local
      device: '/srv/runner'
      o: bind
