12345678910111213141516171819202122232425262728293031323334353637 |
- FROM python:3.8.19-slim
- WORKDIR /web/ASJPush
- # 安装系统依赖
- RUN apt-get update && \
- apt-get install -y --no-install-recommends \
- apt-utils \
- gcc \
- libffi-dev \
- libssl-dev \
- supervisor \
- # 添加pkg-config工具
- pkg-config \
- default-libmysqlclient-dev \
- mariadb-client \
- # 添加MariaDB开发库
- libmariadb-dev \
- libgl1 \
- libglib2.0-0 \
- && rm -rf /var/lib/apt/lists/*
- # 先安装Python依赖
- COPY requirements.txt .
- RUN pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple && \
- pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
- # 复制私有包到PYTHONPATH
- COPY ./Docker/libs/ /usr/local/lib/python3.8/site-packages/
- # 复制项目其他文件和supervisor配置
- COPY . .
- COPY ./Docker/conf/supervisord_*.conf /etc/supervisor/
- # 动态使用 supervisor 配置
- ENV SUPERVISOR_CONF=supervisord_test.conf
- CMD ["/bin/sh", "-c", "/usr/bin/supervisord -n -c /etc/supervisor/${SUPERVISOR_CONF}"]
|