Files
tg-telegram-imagebed/Dockerfile
Developer 77289bc056 release: 增强应用更新机制,支持 Release Artifact
- 在管理后台系统设置中新增应用更新相关字段。
- 实现从 VERSION 文件动态加载版本号。
- 更新设置 API,加入 Release Artifact 配置。
- 重构更新服务,支持下载并校验 Release 资源(assets)。
- 为下载资源引入 SHA256 校验,确保完整性。
- 增加更新失败回滚机制,使用备份文件恢复。
- 更新更新运行时信息结构,以反映新的 Release Artifact 方案。
- 新增 VERSION 文件,用于应用版本管理。
2026-02-28 03:43:57 +08:00

55 lines
1.1 KiB
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ==================== 阶段1: 构建前端 ====================
FROM node:20-alpine AS frontend-builder
# 设置工作目录
WORKDIR /frontend
# 复制前端依赖文件
COPY frontend/package*.json ./
# 安装所有依赖(包括开发依赖,构建时需要)
RUN npm ci
# 复制前端源码
COPY frontend/ ./
# 构建前端
RUN npm run generate
# ==================== 阶段2: 构建最终镜像 ====================
FROM python:3.11-slim
# 设置工作目录
WORKDIR /app
# 安装系统依赖
RUN apt-get update && apt-get install -y \
gcc \
curl \
&& rm -rf /var/lib/apt/lists/*
# 复制 requirements.txt
COPY requirements.txt .
# 安装 Python 依赖
RUN pip install --no-cache-dir -r requirements.txt
# 创建必要的目录结构
RUN mkdir -p /app/data
# 复制后端代码(根目录仅 main.py其余都在 tg_imagebed 包内)
COPY VERSION .
COPY main.py .
COPY tg_imagebed/ ./tg_imagebed/
# 从前端构建阶段复制构建产物
COPY --from=frontend-builder /frontend/.output/public /app/frontend/.output/public
# 暴露端口
EXPOSE 18793
# 设置环境变量
ENV PYTHONUNBUFFERED=1
CMD ["python", "main.py"]