services:
  beecr-ai:
    container_name: beecr-ai
    image: "cr.yandex/crpnppdjigsa1876k1eq/beecr/ai"
    restart: always
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu]
    environment:
      # Host and port for the socket to bind.
      #
      # Use [::] instead of 0.0.0.0 to bind to IPv6.

      - "OLLAMA_HOST=0.0.0.0:11435"



      # Number of parallel threads for Ollama.
      #
      # More threads means more parallel processing, but also more
      # GPU memory usage.
      #
      # Keep this option synchronized between the AI and API servers.

      - "OLLAMA_NUM_PARALLEL=2"



  beecr-api:
    container_name: beecr-api
    image: "cr.yandex/crpnppdjigsa1876k1eq/beecr/api"
    restart: always
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu]
    ports:
      # Port forwarding rule for the API server.
      #
      # Format: "externalport:internalport".
      # Keep the internal port unchanged unless you know what you are doing.
      - "8000:80"
    volumes:
      # Mount license file.
      #
      # Format: "externalpath:internalpath:mode".
      # Keep the internal path unchanged unless you know what you are doing.
      - "./beecr.lic:/app/beecr.lic:ro"
    environment:
      # Host and port for the socket to bind.
      #
      # Use [::] instead of 0.0.0.0 to bind to IPv6.

      - "HOST=0.0.0.0"
      - "PORT=80"



      # Default GitLab host and token.
      #
      # If the API client explicitly passes these parameters in the request,
      # it will take precedence over the server's settings.

      # - "GITLAB_HOST=https://gitlab.com"
      # - "GITLAB_TOKEN="



      # Ollama-compatible API settings.
      #
      # If the API client explicitly passes this parameter in the request,
      # it will take precedence over the server's settings.

      - "OLLAMA_HOST=http://beecr-ai:11435"



      # OpenAI-compatible API settings.
      #
      # Define only if you wish to use AI models via OpenAI-compatible API.
      #
      # If the API client explicitly passes these parameters in the request,
      # it will take precedence over the server's settings.

      # - "OPENAI_HOST=https://api.openai.com"
      # - "OPENAI_API_KEY="



      # Default AI model name.
      #
      # For OpenAI-compatible APIs use model names as they are,
      # e.g. "gpt-4o".
      #
      # For Ollama-compatible APIs use model names with the prefix "ollama/",
      # e.g. "ollama/codestral:22b".
      #
      # If the API client explicitly passes this parameter in the request,
      # it will take precedence over the server's settings.

      - "MODEL=ollama/codestral:22b"



      # Expected GPU memory in GB for Ollama.
      #
      # This is essential to define the proper amount of GPU memory on the
      # AI server when using Ollama-compatible models.
      #
      # If your AI server has multiple GPUs, you should pass the sum of
      # all GPUs memory.

      - "OLLAMA_GPU_MEM=24"



      # Expected number of parallel threads for Ollama.
      #
      # This is essential to define the proper number of parallel
      # processing threads when using Ollama-compatible models.
      #
      # Keep this option synchronized between the AI and API servers.

      - "OLLAMA_NUM_PARALLEL=2"



      # Default review target settings.
      #
      # TARGET defines a regex pattern for matching files.  
      # For example the "\.(py|java|sh)$" regex enables the review
      # for the following languages:
      #   - Python
      #   - Java
      #   - Bash/Shell
      # Default value:
      #   \.(py|c|h|cpp|hpp|cs|java|kt|swift|php|go|sh|(j|t)sx?)$
      #
      # TARGET_EXTRA defines an additional regex pattern for matching files.
      # Useful if you don't want to redefine TARGET completely.
      # By default, the TARGET_EXTRA regex is empty.
      #
      # TARGET_EXCLUDE defines a regex pattern to exclude files from review
      # (even if they are matched by TARGET or TARGET_EXTRA).
      # Useful if you don't want to redefine TARGET.
      # By default, the TARGET_EXCLUDE regex is empty.
      #
      # If the API client explicitly passes these parameter in the request,
      # it will take precedence over the server's settings.

      # - "TARGET=\.(py|c|h|cpp|hpp|cs|java|kt|swift|php|go|sh|(j|t)sx?)$"
      # - "TARGET_EXTRA="
      # - "TARGET_EXCLUDE="



      # Default review language.
      #
      # By default, review comments will be produced in English.

      # - "LANGUAGE=English"



      # Default repository configuration path.
      #
      # By default, the API server will try to get settings from
      # the ".beecr.yml" file in project's repository root.

      # - "REPO_CONFIG_PATH=.beecr.yml"


      # Trigger in notes.
      #
      # If BeeCR integrated via webhooks for "Comment" events then
      # It will review the changes in MR if the following trigger
      # has been mentioned in the note.
      #
      # By default, the API server will trigger by "/beecr".

      # - "NOTE_TRIGGER=/beecr"
