1234567891011121314151617181920212223242526272829303132 |
- FROM python:3.11.11-slim
- RUN pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
- # 设置工作目录
- WORKDIR /app
- # 设置环境变量
- ENV PYTHONUNBUFFERED=1 \
- PYTHONDONTWRITEBYTECODE=1 \
- PIP_NO_CACHE_DIR=1
- # 安装系统依赖
- RUN apt-get update && apt-get install -y --no-install-recommends \
- build-essential \
- libmagic1 \
- && rm -rf /var/lib/apt/lists/*
- # 复制项目文件
- COPY . .
- # ENV MONGODB=mongodb://root:root@172.31.69.25:37018/
- # ENV ALIYUN_FUNCTION_URL=https://imagefeature-hauveswkcf.cn-hangzhou.fcapp.run
- # 安装Python依赖
- RUN pip install --no-cache-dir -r requirements.txt
- EXPOSE 5000
- # 设置默认命令
- CMD ["python", "app.py"]
|