> ## Documentation Index
> Fetch the complete documentation index at: https://docs.shaktistudio.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploying a Docker Container

This guide walks you through the complete process of deploying Docker containers to Shakti Studio platform, from credential setup to deployment.

## Prerequisites

* Docker images uploaded to your **Docker Hub repository.**
* **Docker Hub** account with appropriate access permissions:

> **Important**: Ensure your Docker Hub credentials have ***read access*** to your repositories.

## Part 1: Setting Up Docker Hub Credentials

### Creating a Secret:

1. Navigate to the **Integrations** section in your Shakti Studio dashboard
2. Select [**Secrets**](https://shaktistudio.ai/integrations/secrets) from the menu
3. Click **Create Secret** and configure:
   * **Secret Name**: Enter a name for your secret.
   * **Secret Type**: Select **Docker Hub** from the dropdown.
   * **Credentials**: Enter your Docker Hub ***username*** and ***access token***.

<img src="https://mintcdn.com/simplismart-2/6nk4T32zrycQTOqW/images/model-suite/deployments/deploy-docker-container/1-create-secret.png?fit=max&auto=format&n=6nk4T32zrycQTOqW&q=85&s=c2d882a185e575a302c4b86c4f3e7691" alt="Create Secret" width="3008" height="1465" data-path="images/model-suite/deployments/deploy-docker-container/1-create-secret.png" />

## Part 2: Adding Your Docker Image

### Model Configuration

1. Go to the **My Models** page
2. Click **Add Model** and provide:
   * **Model Name**: Descriptive name for your application
   * **Source**:  Select the model source as **DockerHub** from the dropdown
   * **Registry Path**: Your **Docker Hub** registry path
   * **Image Tag**: Specify the image *version/ tag*
   * **GPU Per Container**: Default is set to `1`. You can allocate maximum 8 GPUs.
   * **Credentials**: Select the **Docker Hub**  secret created earlier
3. The system will verify your image path and add it to your models list

<img src="https://mintcdn.com/simplismart-2/6nk4T32zrycQTOqW/images/model-suite/deployments/deploy-docker-container/2-add-model-details.png?fit=max&auto=format&n=6nk4T32zrycQTOqW&q=85&s=de412321977987bf0a8d6723c7dd55db" alt="Add Model" width="3000" height="1508" data-path="images/model-suite/deployments/deploy-docker-container/2-add-model-details.png" />

## Part 3: Deployment Configuration

### Basic Setup

1. From the **My Models** section, select the previously added **model** and click on **Deploy Model**
2. Configure basic details:
   * **Deployment Name**: Enter a unique name for this deployment.
   * **Cluster**: Select **Shakti Cloud** as the cluster.
   * **Node Group**: Choose the required **node group** (H100/L40S).

<img src="https://mintcdn.com/simplismart-2/6nk4T32zrycQTOqW/images/model-suite/deployments/deploy-docker-container/3-create-deployment-basic-details.png?fit=max&auto=format&n=6nk4T32zrycQTOqW&q=85&s=cca80bb8db8b12e7eeecf63870dba5ad" alt="Create Deployment: Add Basic Details" width="3016" height="1510" data-path="images/model-suite/deployments/deploy-docker-container/3-create-deployment-basic-details.png" />

### Container Configuration

#### Service Configuration

Configure how external traffic reaches your container:

* **HTTP Service** (Required):
  * For example: 8000 (or your application's port) (The port on which your server will be running).
  * This exposes your service within the cluster.
* **Optional Services**:
  * **gRPC Service**: Enable if your application uses gRPC. (This port can't be the same as **http** service port)
  * **Monitoring Service**: Add for enhanced monitoring capabilities.

#### Health Check Settings

Essential for monitoring container health:

* **Health Check Path**: /health (endpoint your app responds to)
* **Port**: 8000 (same as your HTTP service port)
* **Initial Delay**: 30 seconds (startup time allowance)
* **Check Interval**: 10 seconds (frequency of health checks)
* **Timeout**: 5 seconds (maximum response wait time)

<img src="https://mintcdn.com/simplismart-2/6nk4T32zrycQTOqW/images/model-suite/deployments/deploy-docker-container/4-create-deployment-container-configuration.png?fit=max&auto=format&n=6nk4T32zrycQTOqW&q=85&s=9f80a9055262bef05ea5ccba7ccdb007" alt="Create Deployment: Configuration" width="3008" height="1516" data-path="images/model-suite/deployments/deploy-docker-container/4-create-deployment-container-configuration.png" />

#### Environment Variables (Optional)

Set runtime environment variables as needed:

* Add key-value pairs for configuration
* Use the + button to add multiple variables

#### Command Override (Optional)

Override the default container startup command:

* Specify the command to run in the container to **override** the **default command**. Add each part of the command as a separate entry and then press enter or click on the add button.

<img src="https://mintcdn.com/simplismart-2/6nk4T32zrycQTOqW/images/model-suite/deployments/deploy-docker-container/5-create-deployment-command-override.png?fit=max&auto=format&n=6nk4T32zrycQTOqW&q=85&s=51a668aef27a42ba970b238bc75a9dd3" alt="Create Deployment: Command Override" width="2992" height="1054" data-path="images/model-suite/deployments/deploy-docker-container/5-create-deployment-command-override.png" />

### Scaling Parameters

* **Range**: Set minimum and maximum instances (1-8)
* **Scaling Metric**: Choose **CPU usage / memory usage** as the scaling trigger
* **Threshold**: Define the percentage that triggers scaling \
  *(e.g CPU Utilisation 80%)*

#### Node Distribution (Node Anti-Affinity)

Control how your containers are distributed across nodes:

* **No Affinity**: Containers deployed anywhere resources are available
* **Preferred**: System attempts to distribute across different nodes when possible
* **Required**: Strict enforcement of separate node placement

#### Advanced Options

* **Rapid Auto-scaling**: Enable for faster scaling response when needed

<img src="https://mintcdn.com/simplismart-2/6nk4T32zrycQTOqW/images/model-suite/deployments/deploy-docker-container/6-create-deployment-scaling-params.png?fit=max&auto=format&n=6nk4T32zrycQTOqW&q=85&s=1b08e4c131cef5a7cdf2ffb5f9d11853" alt="Create Deployment: Scaling Parameters" width="3020" height="1509" data-path="images/model-suite/deployments/deploy-docker-container/6-create-deployment-scaling-params.png" />

## Part 4: Deployment

1. Review all configuration settings
2. Click **Add Deployment** to initiate the deployment process
3. Monitor the deployment status

## Part 5: Monitoring and Access

### Health Status

Once deployed successfully, you'll see:

* **Health Status**: **Healthy** indicator on the deployment page
* **Deployment URL**: Direct access link to your application

### Troubleshooting

* Verify the health check endpoint is properly implemented in your application
* Ensure Docker image is accessible with the provided credentials
* Confirm port configuration matches your application
