api-version: 2024-02-02-preview
location: {{ .Env.AZURE_LOCATION }}
identity:
  type: UserAssigned
  userAssignedIdentities:
    ? "{{ .Env.AZURE_CONTAINER_REGISTRY_MANAGED_IDENTITY_ID }}"
    : {}
properties:
  environmentId: {{ .Env.AZURE_CONTAINER_APPS_ENVIRONMENT_ID }}
  configuration:
    activeRevisionsMode: single
    runtime:
      dotnet:
        autoConfigureDataProtection: true
    ingress:
      external: false
      targetPort: 11434
      transport: http
      allowInsecure: true
    registries:
      - server: {{ .Env.AZURE_CONTAINER_REGISTRY_ENDPOINT }}
        identity: {{ .Env.AZURE_CONTAINER_REGISTRY_MANAGED_IDENTITY_ID }}
  template:
    volumes:
      - name: ollama-onlineshopapphosta2d2d5fe79ollamaollama
        storageType: AzureFile
        storageName: {{ .Env.SERVICE_OLLAMA_VOLUME_ONLINESHOPAPPHOSTA2D2D5FE79OLLAMAOLLAMA_NAME }} 
    containers:
      - image: {{ .Image }}
        name: ollama
        env:
          - name: AZURE_CLIENT_ID
            value: {{ .Env.MANAGED_IDENTITY_CLIENT_ID }}
        volumeMounts:
          - volumeName: ollama-onlineshopapphosta2d2d5fe79ollamaollama
            mountPath: /root/.ollama
    scale:
      minReplicas: 1
tags:
  azd-service-name: ollama
  aspire-resource-name: ollama
