services:
  java-ssh:
    container_name: jenkins-runner
    build:
      context: .
      dockerfile: Dockerfile
      args:
        RUNNER_USER: "runner"
        RUNNER_PASSWORD: "izh!987!neazjJENjbEKBzbeZEU2YI3U13bzhbeKJBZEKBjhvIU2Y13IGHbejhvjVZEHV1J2VH3K1B"
    networks:
      - runner
    ports:
      - "777:22"
    restart: unless-stopped
    volumes:
      - runner-data:/home/runner
      - runner-docker-certs:/certs/client:ro
  docker:
    image: docker:dind
    container_name: jenkins-docker
    privileged: true
    environment:
      DOCKER_TLS_CERTDIR: /certs
    networks:
      runner:
        aliases:
          - docker
    volumes:
      - runner-docker-certs:/certs/client
      - runner-data:/home/runner
    ports:
      - "127.0.0.1:2376:2376"
    command: ["--storage-driver", "overlay2"]
    restart: unless-stopped

volumes:
  runner-data:
  runner-docker-certs:

networks:
  runner:
