Sdcb Chats is a powerful and flexible frontend for large language models that supports various features and platforms. Whether you want to manage multiple model interfaces or need a simple deployment process, Sdcb Chats can meet your needs. In this post, I will show you how to deploy Sdcb Chats on Azure Container Apps, the goal is to run it on full PaaS environment, without creating and managing a VM. 

Idea and Problem


Traditionally, deploying Sdcb Chats involves running a Docker container on a virtual machine, like so:

mkdir ./AppData && chmod 777 ./AppData

docker run -d --restart unless-stopped --name sdcb-chats -e DBType=sqlite -e ConnectionStrings__ChatsDB="Data Source=./AppData/chats.db" -v ./AppData:/app/AppData -p 8080:8080 sdcb/chats:latest

In a production environment, you’d also set up a separate web proxy and configure TLS to secure your traffic.

But what changes when moving to a fully managed cloud solution without VMs? There are two key challenges to address:

  1. Persistent Data Storage:
    How do we mount a volume for Sdcb Chats data so it persists beyond container restarts?

  2. Custom Domain & HTTPS:
    How can we bind a custom domain and ensure secure (HTTPS) access for users?

The good news is that Azure Container Apps handle both of these requirements seamlessly—with just a few simple steps in the portal.

Let’s walk through how you can do this with ease.

Create Storage Account and File Share


First thing we do is to create a Storage Account and a File Share, this will later act as the mounted volume in the Docker container.

First, create an Azure Storage Account as usual. Then go to File shares blade, click + File share

Then, create a file share with a name, and select Transaction optimized for the Access tier. You can disable Backup if you don't need it.

Go to Access keys, and copy one of the keys. 

Make sure you copied all three things in this step. We'll use them later.

  • Storage Account name
  • File Share name
  • Storage Account key

Create Container App


Next, create a new Container App

Basics Tab

  • Deployment source: Container image
  • Region: I would suggest using the same region as your storage account. In my case, both of them are in Japan East.

Container Tab

  • Image source: Docker Hub or other registries
  • Image type: Public
  • Registry login server: docker.io
  • Image and tag: sdcb/chats:latest
  • Workload profile: Consumption
  • CPU and memory: 2 CPU / 4GB
  • Add 3 environment variables:
    • DBType: sqlite
    • ConnectionStrings__ChatsDB: Data Source=./AppData/chats.db
    • JwtSecretKey: <Any GUID>

Ingress Tab

  • Ingress: Enabled
  • Ingress traffic: Accepting traffic from anywhere
  • Target port: 8080

Configure File Share


Go to the Container Apps Environment (NOT Container App) that just created. Navigate to Azure Files blade and add a new SMB file share.

Give it a name, and fill everything you copied in the first step.

Set Access mode to Read/Write. This is important as Sdcb Chats program will both read and write the database.

Then, go to the Container App we just created. Go to Volumes blade and add a new volume.

  • Type: Azure file volume
  • Name: appdata (or any name you can use)
  • File share name: Select the file share name we just created in the previous step
  • Mount options: nobrl (disable sending byte range lock requests to the server and for applications which have challenges with posix locks)

Go to Containers blade. In Volume mounts tab, mount appdata volume to /app/AppData

Now, you should be able to open your Sdcb Chats instance by the default URL. 

Additionally, you can set min replicas to 1 to keep the application always up.

Setup Domain and HTTPS Binding


The last step is to bind your custom domain and enable HTTPS. You can easily do this in Custom domains tab by following the instructions on screen.

Want Fully Automated Script?


Deploying Sdcb Chats on Azure Container Apps can be even more simple by using Bicep. You can see my previous blog post: Automating Deployment of Open WebUI on Azure Container Apps with Bicep to create your own Bicep script for Sdcb Chats.