You can deploy the NarratoAI WebUI using Docker Compose. The service maps port 8501 on the host to port 8501 in the container. It uses a local storage directory, a config.toml file, and a resource directory for persistent data and configuration.
Required local files/directories:
./storage (directory)./config.toml (file)./resource (directory, read-write)
Environment Variables:
PYTHONUNBUFFERED=1: Ensures Python output is sent straight to the container logs.TZ=Asia/Shanghai: Sets the container timezone to Asia/Shanghai.
services:
narratoai-webui:
build:
context: .
dockerfile: Dockerfile
image: narratoai:latest
container_name: narratoai-webui
ports:
- "8501:8501"
volumes:
- ./storage:/NarratoAI/storage
- ./config.toml:/NarratoAI/config.toml
- ./resource:/NarratoAI/resource:rw
environment:
- PYTHONUNBUFFERED=1
- TZ=Asia/Shanghai
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8501/_stcore/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s