Skip to content

Latest commit

 

History

History
75 lines (59 loc) · 2.06 KB

File metadata and controls

75 lines (59 loc) · 2.06 KB

🐳 使用 Docker Compose 進行私有化部署 / Private Deployment using Docker Compose

本教學引導您如何在自己的伺服器 (VPS) 或本地電腦上,使用 Docker 一鍵部署 TeleFileDB+。 This guide walks you through deploying TeleFileDB+ on your own server (VPS) or local machine using Docker.


1. 前置準備 / Prerequisites

確保您的系統已安裝以下工具: Check if you have these tools installed:

  • Docker
  • Docker Compose
  • Git

2. 下載專案 / Clone the Project

git clone https://github.com/您的用戶名/TeleFileDB-Plus.git
cd TeleFileDB-Plus

3. 配置環境變數 / Configuration

  1. 建立環境檔案 / Create .env file:
    cp .env.example .env  # 如果沒有範例,請手動建立 .env
  2. 編輯 .env / Edit .env: 使用 nanovim 填入您的 BOT_TOKEN, API_ID, API_HASH 以及 DB_URL (Supabase 鏈結)。 Fill in your credentials in the .env file.

4. 啟動服務 / Launch Services

在專案根目錄執行以下指令: Run the following command in the project root:

docker-compose up -d --build

這會自動下載映像檔、編譯代碼並在背景運行所有組件。 This will build and start all components in the background.


5. 初始化管理員與資料庫 / Initialization (Critical)

重要:初次部署必須執行以下兩條指令: IMPORTANT: You must run these two commands for the first-time setup:

  1. 建立管理員帳號 / Create Admin:
    docker exec -it telefiledb_app flask create-admin
  2. 建立資料庫表結構 / Migrate Database:
    docker exec -it telefiledb_app python migrate_db.py

6. 開始使用 / Access the App

預設端口為 7860。在瀏覽器輸入: Access the app via port 7860: http://您的伺服器IP:7860


💡 維護與更新 / Maintenance & Updates

當您想更新到最新版本時: To update to the latest version:

git pull
docker-compose up -d --build