Files
doc-uploader/file-upload-site/Dockerfile
2026-06-12 14:27:19 +08:00

23 lines
452 B
Docker
Raw 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.
FROM python:3.10-slim
# 系统依赖python-magic 需要 libmagic
RUN apt-get update && \
apt-get install -y --no-install-recommends libmagic1 && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
# 先复制依赖文件,利用 Docker 缓存
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# 复制应用代码
COPY . .
# 创建默认上传目录
RUN mkdir -p /app/uploads
EXPOSE 5000
CMD ["python3", "app.py"]