LABLAB / Dockerfile
Marcus719's picture
Create Dockerfile
997640e verified
raw
history blame contribute delete
578 Bytes
FROM python:3.9-slim
WORKDIR /app
# 安装必要的编译工具
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
software-properties-common \
&& rm -rf /var/lib/apt/lists/*
COPY . .
# 优先安装依赖,利用 Docker 层缓存
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# 设置 HF 用户权限
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]