# version: "3.5"

# services:
#   dind:
#     image: docker:20-dind
#     restart: always
#     privileged: true
#     environment:
#       DOCKER_TLS_CERTDIR: ""
#     command:
#       - --storage-driver=overlay2

#   runner:
#     restart: always
#     image: registry.gitlab.com/gitlab-org/gitlab-runner:alpine
#     depends_on:
#       - dind
#     environment:
#       - DOCKER_HOST=tcp://dind:2375
#     volumes:
#       - ./config:/etc/gitlab-runner:z

#   register-runner:
#     restart: 'no'
#     image: registry.gitlab.com/gitlab-org/gitlab-runner:alpine
#     depends_on:
#       - dind
#     environment:
#       - CI_SERVER_URL=${CI_SERVER_URL}
#       - REGISTRATION_TOKEN=${REGISTRATION_TOKEN}
#     command:
#       - register
#       - --non-interactive
#       - --locked=false
#       - --name=${RUNNER_NAME}
#       - --executor=docker
#       - --docker-image=docker:20-dind
#       - --docker-volumes=/var/run/docker.sock:/var/run/docker.sock
#     volumes:
#       - /srv/gitlab-runner:/etc/gitlab-runner:z


version: '3'
services:
  gitlab-runner:
    environment:
      - CI_SERVER_URL=${CI_SERVER_URL}
      - REGISTRATION_TOKEN=${REGISTRATION_TOKEN}
    image: 'gitlab/gitlab-runner:latest'
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /srv/gitlab-runner:/etc/gitlab-runner
    restart: unless-stopped