{
  "id": "/{{bitbucket.name}}",
  "instances": {{bitbucket.instances}},
  "cpus": {{bitbucket.cpus}},
  "mem": {{bitbucket.mem}},
  "maintainer": "support@mesosphere.io",
  "container": {
    "type": "DOCKER",
    "docker": {
      "image": "{{resource.assets.container.docker.bitbucket-docker}}",
      "network": "BRIDGE",
      "portMappings": [
        { "containerPort": 7990, "hostPort": 0 },
        { "containerPort": 7999, "hostPort": 0 }
      ]
    },
    "volumes": [
    {
        "containerPath": "/var/atlassian/application-data/bitbucket",
        "hostPath": "{{bitbucket.host-volume}}",
        "mode": "RW"
    }
    ]
  },
  "healthChecks": [
    {
      "protocol": "COMMAND",
      "command": { "value": "curl --fail ${HOST}:${PORT0}" },
      "gracePeriodSeconds": 300,
      "intervalSeconds": 60,
      "timeoutSeconds": 20,
      "maxConsecutiveFailures": 3
    }
  ],
  "acceptedResourceRoles": [
    "{{bitbucket.role}}"
  ],
  "labels": {
    {{#bitbucket.virtual-host}}
    "HAPROXY_GROUP":"external",
    "HAPROXY_0_VHOST":"{{bitbucket.virtual-host}}",
    {{/bitbucket.virtual-host}}
    "DCOS_SERVICE_NAME": "{{bitbucket.name}}",
    "DCOS_SERVICE_SCHEME": "http",
    "DCOS_SERVICE_PORT_INDEX": "0"
  }
}
