---
title: "Parse Docker Compose file into a deployment template"
method: POST
path: "/api/templates/docker-compose"
tags: ["templates"]
---

# Parse Docker Compose file into a deployment template

`POST /api/templates/docker-compose`

## Request

- Base URL: `https://api.hostim.dev`
- URL: `https://api.hostim.dev/api/templates/docker-compose`
- Auth: HTTP bearer

Uploads a Docker Compose YAML file and returns a generated deployment template

## Request body

- object
  - `composeYAML` string, required: Raw Docker Compose YAML content

## Response `200`

Parsed template returned successfully

- Template
  - `id` string, required
  - `name` string, required
  - `description` string, required
  - `category` string: Logical grouping for UI (e.g. 'Examples', 'Open Source', 'Custom')
  - `sourceUrl` string, uri: Optional link to GitHub or external documentation
  - `notes` string[]: Optional setup notes or tips, such as default credentials
  - `components` object, required
    - `apps` App[], required
      - `name` string, required: The app name
      - `replicas` integer, required: The number of replicas
      - `public` boolean, required: Whether the app is public or not
      - `builtInDomain` string: The built-in domain of the app
      - `domains` string[], required: The domains of the app
      - `httpPort` integer, nullable: The http port
      - `healthCheckPath` string, nullable: HTTP path used for the readiness probe. Empty/unset disables it.
      - `plan` string, required: The plan of the app
      - `type` string: The type of the app (shared or dedicated)
      - `ram` number: The amount of RAM
      - `cpu` number: The amount of CPU
      - `deploymentSource` object, required: The deployment source
        - `type` 'git' | 'docker', required: The deployment source type
        - `docker` object: The docker deployment source
          - `image` string, required: The docker image
          - `username` string: The docker username
          - `password` string: The docker registry password. Write-only: accepted on create/update but never returned in cleartext on read; read responses return "***" when a password is set. Send "***" back unchanged to keep the stored value.
          - `registry` string: The docker registry host, derived from the image reference. Ignored on create and update: the backend overwrites it with the host parsed out of `image`, so write the registry into the image instead (e.g. `registry.example.com/me/app:1.0`). Not marked readOnly, so clients can send a read app back unchanged.
        - `git` object: The git deployment source
          - `url` string, required: The git url
          - `branch` string: The git branch
          - `token` string: The git access token for private repos. Write-only: accepted on create/update but never returned in cleartext on read; read responses return "***" when a token is set. Send "***" back unchanged to keep the stored value.
          - `dockerfilepath` string: The path to the dockerfile
      - `commandOverride` string: The command override
      - `volumeMounts` object[], required: The storage volumes
        - `name` string: The volume name
        - `mountPath` string: The volume mount path
      - `envVars` EnvVar[]: The environment variables
        - `name` string, required: The env var name
        - `value` string, required: The env var value
      - `cost` number: The cost of the app per month
    - `volumes` Volume[], required
      - `name` string, required: The volume name
      - `plan` string, required: The volume plan
      - `cost` number: The cost of the volume per month
      - `storageMB` number: The size of the volume in MB
    - `mysql` MySQL[], required
      - `name` string, required: The MySQL name
      - `plan` string, required: The plan of the MySQL instance
      - `cost` number: The cost of the MySQL instance per month
      - `type` string: The type of the mysql instance, either shared or dedicated
      - `ram` number: The amount of RAM in GB
      - `cores` number: The number of CPU cores
      - `storageMB` number: The amount of storage in MB
    - `postgres` Postgres[], required
      - `name` string, required: The PostgreSQL name
      - `plan` string, required: The plan of the PostgreSQL instance
      - `cost` number: The cost of the PostgreSQL instance per month
      - `type` string: The type of the PostgreSQL instance, either shared or dedicated
      - `ram` number: The amount of RAM in GB
      - `cores` number: The number of CPU cores
      - `storageMB` number: The amount of storage in MB
      - `extensions` string[]: Extensions requested for this database. Only names returned by /api/postgres/extensions are accepted. Removing a name does not uninstall the extension.
    - `redis` Redis[], required
      - `name` string, required: The Redis name
      - `plan` string, required: The plan of the Redis instance
      - `cost` number: The cost of the Redis instance per month
      - `storage` number: The storage of the Redis instance

## Other responses

- `400`: Invalid file or parsing error
- `401`: User is not authorized
- `500`: Internal server error

---

[API](https://skmtc.dev/hostim/apis/hostim-api.md) · [All operations](https://skmtc.dev/hostim/apis/hostim-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hostim/apis/hostim-api/revisions/37c35e1026a9?raw)
