# Deploying with Docker Compose

## Install

A Tonic Structural Docker Compose repository is located here: <https://github.com/TonicAI/tonic_docker_compose>.

To make future updates easier, fork this repository.

The repository readme includes more detail on how to set environment settings. It also provides information on how to determine which containers are required for your deployment. For example,  whether you use Docker to deploy the Structural application PostgreSQL database.

When you sign up with Structural, you are provided access credentials to our image repository. If you require new credentials, or you are unable to access the repository, contact <support@tonic.ai> to get access to our Quay.io Docker repository.

On the machine where you plan to deploy Structural, log in to Quay.io with credentials that Structural provides:

```
$ docker login quay.io
```

## Configure

Review the [configuration option details in the repository readme](https://github.com/TonicAI/tonic_docker_compose#configuration).

## Deploy

To deploy and validate access to Structural, follow the [instructions in the repository readme](https://github.com/TonicAI/tonic_docker_compose#deploy).

{% hint style="info" %}
If you run Structural in a cloud environment, we **strongly** suggest that you enable SSL, or that you use some other mechanism to protect traffic to the machine. For example, you might make the instance available only over VPN. Your cloud provider should have instructions on how to accomplish this.
{% endhint %}

## Update

Structural notifies you when the current version is more than 10 versions behind the most recent release. The notification is on the **System Status** tab of **Structural Settings** view.

Before you update, make sure to back up your Structural application database.

At a minimum, to update Structural, run the following:

```
$ docker compose down
$ docker compose pull && docker compose up -d
```

To free additional disk space before you complete the update, you can optionally include commands to remove unused images and volumes.

```
$ docker compose down
$ docker image prune -a
$ docker volume prune -a
$ docker compose pull && docker compose up -d
```

If you use the Compose [standalone](https://docs.docker.com/compose/install/other/#on-linux), then use the `docker-compose` syntax instead of `docker compose`.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tonic.ai/app/admin/on-premise-deployment/deploying-with-docker-compose.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
