仪评指标联分析模块

This commit is contained in:
BBIT-Kai
2025-09-24 13:59:00 +08:00
parent 0ab82b00d6
commit d2775f60a7
28 changed files with 1106 additions and 181 deletions
+42
View File
@@ -0,0 +1,42 @@
# 使用官方 Python 镜像
FROM python:3.10-slim
WORKDIR /app
RUN apt-get update && \
apt-get install -y --no-install-recommends \
libpq5 \
unixodbc \
curl \
gnupg \
apt-transport-https \
lsb-release && \
# 导入微软 GPG key(使用 keyrings 方式)
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /usr/share/keyrings/microsoft.gpg && \
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/microsoft.gpg] https://packages.microsoft.com/ubuntu/22.04/prod jammy main" > /etc/apt/sources.list.d/mssql-release.list && \
apt-get update && \
ACCEPT_EULA=Y apt-get install -y msodbcsql18 && \
rm -rf /var/lib/apt/lists/*
COPY docker/requirements.txt .
# 安装 Python 依赖
RUN pip install --no-cache-dir -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt
# 复制并解压 JRE
COPY docker/OpenJDK17U-jre_x64_linux_hotspot_17.0.16_8.tar.gz /opt/
RUN tar -xzf /opt/OpenJDK17U-jre_x64_linux_hotspot_17.0.16_8.tar.gz -C /opt/ && \
rm /opt/OpenJDK17U-jre_x64_linux_hotspot_17.0.16_8.tar.gz
# 配置 Java 环境
ENV JAVA_HOME=/opt/jdk-17.0.16+8-jre
ENV PATH="$JAVA_HOME/bin:$PATH"
# 复制项目代码
COPY app/ .
EXPOSE 13011
# 启动命令(使用 uvicorn 启动 FastAPI
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "13011", "--workers", "4"]