Create Isolated Nodes

Sometimes it’s beneficial to create an isolated work nodes for CI or other heavy operations that would not put load onto the user facing instances. Often a use case for that is to have your CI instances connect to such isolated nodes putting a big load, such as cloning repositories each minute.

This can be achieved by creation additional nodes in the apps override file.

Open file .custom/docker-compose-apps.override.yaml and add dedicated sections for example CI nodes. In the example below we create 2 isolated nodes rhodecode-ci and vcsserver-ci used by rhodecode-ci in addition we specify a new traefik rule .rule=Host(`ci-docker-dev)` that would only redirect trafic to this node in host matches ci-docker-dev This means a 2nd domain would be possible to run alongside. Traffic hitting that specific domain will only be handled by those specific 2 nodes defined.

  rhodecode-ci:
    extends:
      file: docker-compose-apps.yaml
      service: rhodecode_base
    deploy:
      replicas: 1
#    #custom command in case of modified rhodecode.ini should be used
#    command: [
#      "/usr/local/bin/rhodecode_bin/bin/gunicorn",
#      "--error-logfile=-",
#      "--paster=/etc/rhodecode/conf/rhodecode.ini",
#      "--config=/etc/rhodecode/conf/gunicorn_conf_rc.py"
#    ]
    environment:
      RC_APP_PORT: "10020"
       #vcs.server = x .ini file override
      RC_VCS_SERVER: "vcsserver-ci:10010"
    labels:
      - "autoheal=true"
      - "traefik.enable=true"
      # HTTP + SSL example, should be put into .custom/docker-compose-apps.override.yaml
      #- "traefik.http.routers.rhodecode-ci.entrypoints=http,https"
      - "traefik.http.routers.rhodecode-ci.entrypoints=http"
      - "traefik.http.routers.rhodecode-ci.priority=10"
      - "traefik.http.routers.rhodecode-ci.rule=Host(`ci-docker-dev`)"
      - "traefik.http.routers.rhodecode-ci.service=rhodecode-ci-service"
      - "traefik.http.services.rhodecode-ci-service.loadbalancer.server.port=10020"

  vcsserver-ci:
    extends:
      file: docker-compose-apps.yaml
      service: vcsserver
    deploy:
      replicas: 1
#    #custom command in case of modified vcsserver.ini should be used
#    command: [
#       "/usr/local/bin/rhodecode_bin/vcs_bin/gunicorn",
#       "--error-logfile=-",
#       "--paster=/etc/rhodecode/conf/vcsserver.ini",
#       "--config=/etc/rhodecode/conf/gunicorn_conf_vcs.py"
#    ]
    labels:
      - "autoheal=true"
      - "traefik.enable=true"