You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
395 B
19 lines
395 B
FROM python:3.14-slim
|
|
|
|
WORKDIR /app
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1
|
|
ENV PYTHONUNBUFFERED=1
|
|
|
|
# 如果不需要编译 C 扩展,可以跳过 gcc 安装
|
|
# 只复制 requirements.txt 并安装 Python 依赖
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY ./app .
|
|
|
|
RUN useradd -m -r appuser && chown -R appuser /app
|
|
USER appuser
|
|
|
|
EXPOSE 8000
|
|
CMD ["python", "main.py"]
|