Skip to content

Latest commit

 

History

History
146 lines (106 loc) · 3.44 KB

File metadata and controls

146 lines (106 loc) · 3.44 KB

Deployment Guide

This project is intended to run on a single Ubuntu server with Docker Compose. Only Nginx is exposed to the public network. Flask, generate-video, and remotion-render communicate through the Docker internal network.

Server Requirements

  • Ubuntu 22.04 or similar Linux distribution.
  • 4 vCPU / 8 GiB RAM is the practical minimum for the current CPU-only path.
  • At least 40 GiB free disk. More is better because uploads, generated videos, Docker images, and Qdrant data grow over time.
  • Public security group/firewall:
    • Open 22/tcp for SSH.
    • Open 80/tcp for HTTP testing.
    • Open 443/tcp later if HTTPS is added.
    • Do not open 5001, 8788, or 8790.

Services

  • nginx: public entrypoint, serves the dashboard and proxies /api.
  • flask-backend: Flask API service on Docker internal port 5001.
  • generate-video: model-video task service on Docker internal port 8788.
  • remotion-render: template-video render service on Docker internal port 8790.

Environment File

Create .env.production in the repository root on the server. This file is ignored by Git and must not be committed. Use .env.example as the key template.

Required groups:

  • LLM: BASE_URL, API_KEY, LLM_MODEL.
  • Embedding: EMBEDDING_TYPE, BAILIAN_API_KEY, BAILIAN_MODEL.
  • ASR, if using cloud ASR: ASR_TYPE, DASHSCOPE_API_KEY or Aliyun ASR keys.
  • S3/Qiniu, if using object storage: S3_AK_ID, S3_AK_SECRET, S3_BUCKET, S3_ENDPOINT.
  • Model video generation: NEWAPI_VIDEO_BASE_URL, NEWAPI_VIDEO_API_KEY, NEWAPI_VIDEO_MODEL.
  • Template video rendering: TEMPLATE_VIDEO_DATA_DIR, TEMPLATE_VIDEO_PUBLIC_BASE, REMOTION_CONCURRENCY.

The local .env.production can be copied to the server by SSH/SCP. Do not paste secrets into issue trackers, Git commits, screenshots, or chat logs.

First Deployment

From the server:

apt-get update
apt-get install -y git
git clone <your-repo-url> ai-fs-all
cd ai-fs-all

Put .env.production at:

/root/ai-fs-all/.env.production

If creating it from the template:

cp .env.example .env.production
nano .env.production

Build and start:

docker compose build
docker compose up -d
docker compose ps

Public test URL:

http://39.106.161.237

Operations

View logs:

docker compose logs -f nginx
docker compose logs -f flask-backend
docker compose logs -f generate-video
docker compose logs -f remotion-render

Restart one service:

docker compose restart flask-backend

Deploy new code:

git pull
docker compose build
docker compose up -d
docker compose ps

Stop all services:

docker compose down

Do not use docker compose down -v unless you intentionally want to delete uploaded files, local Qdrant data, generated model-video data, and template-video outputs.

Health Checks

Basic public checks:

curl -I http://39.106.161.237
curl http://39.106.161.237/api/health

If /api/health is not implemented or returns a non-200 response, check Flask logs first:

docker compose logs --tail=200 flask-backend

Data Volumes

Docker named volumes are used for runtime data:

  • backend-uploads: uploaded files.
  • backend-qdrant: local Qdrant database files.
  • generate-video-data: generated model-video service data.
  • template-video-data: Remotion output files served by Nginx under /template-videos/.

Back these volumes up before destructive maintenance.