Skip to content

Deployment

This guide covers how to deploy mzchat in a production-like environment using Docker and Docker Compose.

The official mzchat-web image is available on GitHub Packages: ghcr.io/mzhang28/mzchat-web:master

This image contains both the backend server and the pre-built frontend assets.

For a complete setup including search capabilities via Meilisearch, use the following docker-compose.yml:

services:
mzchat:
image: ghcr.io/mzhang28/mzchat-web:master
ports:
- "8080:8080"
environment:
# The public URL where the application will be accessible
- CANONICAL_ADDRESS=http://localhost:8080
# Meilisearch configuration
- MEILI_URL=http://search:7700
- MEILI_API_KEY=MASTER_KEY
# Optional: Override the base path (default is /mzchat)
- BASE_PATH=/mzchat
volumes:
- ./mzchat-data:/app/data
depends_on:
- search
search:
image: getmeili/meilisearch:latest
ports:
- "7700:7700"
environment:
- MEILI_MASTER_KEY=MASTER_KEY
volumes:
- ./meili-data:/meili_data
VariableDescriptionDefault
PORTPort the container listens on8080
CANONICAL_ADDRESSPublic URL of the servicehttp://localhost:8080
ASSETS_DOMAINDomain for serving user uploads (Security)CANONICAL_ADDRESS
BASE_PATHURL prefix for the application/mzchat
DATABASE_URLSQLite connection stringfile:/app/data/chat.db
MEILI_URLURL of the Meilisearch instance-
MEILI_API_KEYMeilisearch Master Key-
  • /app/data: Contains the SQLite database (chat.db) and uploaded media.
  • /meili_data: (Search service) Contains the search index data.