Skip to main content

Docker Compose

This deployment method is one step above local development in terms of sophistication. It’s suitable for a development server or simple production environments.

This snippet will give you a quick idea about how to deploy the frontend and backend containers so they play nicely together:

version: "3.8"

volumes:
singulatron-data:
name: singulatron-data
driver: local

services:
singulatron-frontend:
image: crufter/singulatron-frontend:latest
ports:
- "3901:80"
environment:
# The `BACKEND_ADDRESS` must be accessible from the browser.
# It is not an internal address, it's the address the browser will make API requests to.
- BACKEND_ADDRESS=http://127.0.0.1:58231

singulatron-backend:
image: crufter/singulatron-backend:latest
ports:
- "58231:58231"
volumes:
# We mount the docker socket so the backend can start containers
- /var/run/docker.sock:/var/run/docker.sock
# We mount a volume so data will be persisted
- singulatron-data:/root/.singulatron
environment:
# This volume will be mounted by the LLM containers to access the models downloaded by Singulatron.
- SINGULATRON_VOLUME_NAME=singulatron-data
#
# GPU Acceleration for NVIDIA GPUs
# Uncomment this envar for NVIDIA GPUs.
#
# - SINGULATRON_GPU_PLATFORM=cuda

Put the above into a file called docker-compose.yaml in a folder on your computer and run it with the following command:

docker compose up

Once it's running

After the containers successfully start, you can go to 127.0.0.1:3901 and log in with the Default Credentials.

Configuring

See the Backend Environment Variables and Frontend Environment Variables.