Team Ai
Apppublic

Forrest99/codesearchBase

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
Dockerfile31 linesDownload Raw Back to root
1FROM python:3.10-slim2 3# 设置全局环境变量4ENV PYTHONUNBUFFERED=1 \5    PATH="/home/appuser/.local/bin:${PATH}"6 7# 安装系统依赖8RUN apt-get update && \9    apt-get install -y --no-install-recommends gcc python3-dev && \10    rm -rf /var/lib/apt/lists/*11 12# 创建应用用户13RUN useradd -m appuser && \14    mkdir -p /model-cache && \15    chown -R appuser:appuser /model-cache16 17# 切换用户18USER appuser19WORKDIR /app20 21# 安装Python依赖(单条RUN指令)22COPY requirements.txt .23RUN pip install --no-cache-dir --upgrade pip && \24    pip install --no-cache-dir gunicorn==21.2.0 && \25    pip install --no-cache-dir -r requirements.txt26 27# 复制应用代码28COPY app.py .29 30EXPOSE 786031CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]