gitlab_w_aptly-compose.yaml 1.44 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
# Docker compose file for getting gitlab runners up and running.
# This configuration was used in a successful setup of aptly and
# gitlab runners where both could successfully communicate within
# the same network over SSH to share new successfully built Hamara
# packages.

version: '3.6'
services:
  gitlab-runner:
    image: gitlab/gitlab-runner:latest
    restart: always
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      ###comment for first run
      #- ./configs/gitlab-runner:/etc/gitlab-runner
    ports:
      - target: 80
        published: 8888
      - target: 22
        published: 2222
    deploy:
        replicas: 1
        resources:
          # Hard limit - Docker does not allow to allocate more
          limits:
            cpus: '2'
            memory: 1200M
          # Soft limit - Docker makes best effort to return to it
          reservations:
            #cpus: '0.25'
            memory: 16M
        # service restart policy
        restart_policy:
          condition: on-failure
          delay: 5s
          max_attempts: 3
          window: 3s
        # service update configuration
        update_config:
          delay: 2s
        # placement constraint - in this case on 'worker' nodes only
        placement:
          constraints: [node.role == worker]
##NETWORKS
networks:
  default:
    external:
      # Name of the aptly container's network
      name: hamara_repo_preliminary_default   # Verify this every time