本教學引導您如何在自己的伺服器 (VPS) 或本地電腦上,使用 Docker 一鍵部署 TeleFileDB+。 This guide walks you through deploying TeleFileDB+ on your own server (VPS) or local machine using Docker.
確保您的系統已安裝以下工具: Check if you have these tools installed:
- Docker
- Docker Compose
- Git
git clone https://github.com/您的用戶名/TeleFileDB-Plus.git
cd TeleFileDB-Plus- 建立環境檔案 / Create .env file:
cp .env.example .env # 如果沒有範例,請手動建立 .env - 編輯 .env / Edit .env:
使用
nano或vim填入您的BOT_TOKEN,API_ID,API_HASH以及DB_URL(Supabase 鏈結)。 Fill in your credentials in the .env file.
在專案根目錄執行以下指令: Run the following command in the project root:
docker-compose up -d --build這會自動下載映像檔、編譯代碼並在背景運行所有組件。 This will build and start all components in the background.
重要:初次部署必須執行以下兩條指令: IMPORTANT: You must run these two commands for the first-time setup:
- 建立管理員帳號 / Create Admin:
docker exec -it telefiledb_app flask create-admin - 建立資料庫表結構 / Migrate Database:
docker exec -it telefiledb_app python migrate_db.py
預設端口為 7860。在瀏覽器輸入:
Access the app via port 7860:
http://您的伺服器IP:7860
當您想更新到最新版本時: To update to the latest version:
git pull
docker-compose up -d --build