Deployment
This guide covers how to deploy mzchat in a production-like environment using Docker and Docker Compose.
Docker Image
Section titled “Docker Image”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.
Docker Compose
Section titled “Docker Compose”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_dataEnvironment Variables
Section titled “Environment Variables”| Variable | Description | Default |
|---|---|---|
PORT | Port the container listens on | 8080 |
CANONICAL_ADDRESS | Public URL of the service | http://localhost:8080 |
ASSETS_DOMAIN | Domain for serving user uploads (Security) | CANONICAL_ADDRESS |
BASE_PATH | URL prefix for the application | /mzchat |
DATABASE_URL | SQLite connection string | file:/app/data/chat.db |
MEILI_URL | URL of the Meilisearch instance | - |
MEILI_API_KEY | Meilisearch Master Key | - |
Volumes
Section titled “Volumes”/app/data: Contains the SQLite database (chat.db) and uploaded media./meili_data: (Search service) Contains the search index data.