# 使用官方Python运行时作为父镜像 FROM python:3.9-slim-buster # 复制 Oracle Instant Client 文件到容器,设置 Oracle Instant Client 的环境变量 ENV LD_LIBRARY_PATH /usr/lib/instantclient COPY instantclient /usr/lib/instantclient # 设置工作目录 WORKDIR /app # 安装所需的包 COPY sources.list /etc/apt/sources.list RUN apt-get update && \ apt-get install -y libaio1 zip unzip && \ apt-get clean COPY pip.conf /etc/pip.conf COPY requirements.txt /usr/bin/ RUN pip install --no-cache-dir -r /usr/bin/requirements.txt # 将你的应用程序拷贝到容器中 COPY auto_python.py /usr/bin/auto_python.py # 打开端口8000供Web服务使用 EXPOSE 8000 # 定义启动命令 CMD ["python3", "/usr/bin/auto_python.py"]