You've already forked DataMate
Develop labeling module (#25)
* refactor: remove db table management from LS adapter (mv to scripts later); change adapter to use the same MySQL DB as other modules. * refactor: Rename LS Adapter module to datamate-python
This commit is contained in:
125
runtime/datamate-python/.env.example
Normal file
125
runtime/datamate-python/.env.example
Normal file
@@ -0,0 +1,125 @@
|
||||
# ====================================
|
||||
# Label Studio Adapter Configuration
|
||||
# ====================================
|
||||
|
||||
# =========================
|
||||
# 应用程序配置
|
||||
# =========================
|
||||
APP_NAME="Label Studio Adapter"
|
||||
APP_VERSION="1.0.0"
|
||||
APP_DESCRIPTION="Adapter for integrating Data Management System with Label Studio"
|
||||
DEBUG=true
|
||||
|
||||
# =========================
|
||||
# 服务器配置
|
||||
# =========================
|
||||
HOST=0.0.0.0
|
||||
PORT=18000
|
||||
|
||||
# =========================
|
||||
# 日志配置
|
||||
# =========================
|
||||
LOG_LEVEL=INFO
|
||||
|
||||
# =========================
|
||||
# Label Studio 服务配置
|
||||
# =========================
|
||||
# Label Studio 服务地址(根据部署方式调整)
|
||||
# Docker 环境:http://label-studio:8080
|
||||
# 本地开发:http://127.0.0.1:8000
|
||||
LABEL_STUDIO_BASE_URL=http://label-studio:8080
|
||||
|
||||
# Label Studio 用户名和密码(用于自动创建用户)
|
||||
LABEL_STUDIO_USERNAME=admin@example.com
|
||||
LABEL_STUDIO_PASSWORD=password
|
||||
|
||||
# Label Studio API 认证 Token(Legacy Token,推荐使用)
|
||||
# 从 Label Studio UI 的 Account & Settings > Access Token 获取
|
||||
LABEL_STUDIO_USER_TOKEN=your-label-studio-token-here
|
||||
|
||||
# Label Studio 本地文件存储基础路径(容器内路径,用于 Docker 部署时的权限检查)
|
||||
LABEL_STUDIO_LOCAL_BASE=/label-studio/local_files
|
||||
|
||||
# Label Studio 本地文件服务路径前缀(任务数据中的文件路径前缀)
|
||||
LABEL_STUDIO_FILE_PATH_PREFIX=/data/local-files/?d=
|
||||
|
||||
# Label Studio 容器中的本地存储路径(用于配置 Local Storage)
|
||||
LABEL_STUDIO_LOCAL_STORAGE_DATASET_BASE_PATH=/label-studio/local_files/dataset
|
||||
LABEL_STUDIO_LOCAL_STORAGE_UPLOAD_BASE_PATH=/label-studio/local_files/upload
|
||||
|
||||
# Label Studio 任务列表分页大小
|
||||
LS_TASK_PAGE_SIZE=1000
|
||||
|
||||
# =========================
|
||||
# Data Management 服务配置
|
||||
# =========================
|
||||
# DM 存储文件夹前缀(通常与 Label Studio 的 local-files 文件夹映射一致)
|
||||
DM_FILE_PATH_PREFIX=/
|
||||
|
||||
# =========================
|
||||
# Adapter 数据库配置 (MySQL)
|
||||
# =========================
|
||||
# 优先级1:如果配置了 MySQL,将优先使用 MySQL 数据库
|
||||
MYSQL_HOST=adapter-db
|
||||
MYSQL_PORT=3306
|
||||
MYSQL_USER=label_studio_user
|
||||
MYSQL_PASSWORD=user_password
|
||||
MYSQL_DATABASE=label_studio_adapter
|
||||
|
||||
# =========================
|
||||
# Label Studio 数据库配置 (PostgreSQL)
|
||||
# =========================
|
||||
# 仅在使用 docker-compose.label-studio.yml 启动 Label Studio 时需要配置
|
||||
POSTGRES_HOST=label-studio-db
|
||||
POSTGRES_PORT=5432
|
||||
POSTGRES_USER=labelstudio
|
||||
POSTGRES_PASSWORD=labelstudio@4321
|
||||
POSTGRES_DATABASE=labelstudio
|
||||
|
||||
# =========================
|
||||
# SQLite 数据库配置(兜底选项)
|
||||
# =========================
|
||||
# 优先级3:如果没有配置 MySQL/PostgreSQL,将使用 SQLite
|
||||
SQLITE_PATH=./data/labelstudio_adapter.db
|
||||
|
||||
# =========================
|
||||
# 可选:直接指定数据库 URL
|
||||
# =========================
|
||||
# 如果设置了此项,将覆盖上面的 MySQL/PostgreSQL/SQLite 配置
|
||||
# DATABASE_URL=postgresql+asyncpg://user:password@host:port/database
|
||||
|
||||
# =========================
|
||||
# 安全配置
|
||||
# =========================
|
||||
# 密钥(生产环境务必修改)
|
||||
SECRET_KEY=your-secret-key-change-this-in-production
|
||||
|
||||
# Token 过期时间(分钟)
|
||||
ACCESS_TOKEN_EXPIRE_MINUTES=30
|
||||
|
||||
# =========================
|
||||
# CORS 配置
|
||||
# =========================
|
||||
# 允许的来源(生产环境建议配置具体域名)
|
||||
ALLOWED_ORIGINS=["*"]
|
||||
|
||||
# 允许的 HTTP 方法
|
||||
ALLOWED_METHODS=["*"]
|
||||
|
||||
# 允许的请求头
|
||||
ALLOWED_HEADERS=["*"]
|
||||
|
||||
# =========================
|
||||
# Docker Compose 配置
|
||||
# =========================
|
||||
# Docker Compose 项目名称前缀
|
||||
COMPOSE_PROJECT_NAME=ls-adapter
|
||||
|
||||
# =========================
|
||||
# 同步配置(未来扩展)
|
||||
# =========================
|
||||
# 批量同步任务的批次大小
|
||||
SYNC_BATCH_SIZE=100
|
||||
|
||||
# 同步失败时的最大重试次数
|
||||
MAX_RETRIES=3
|
||||
Reference in New Issue
Block a user