加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Dockerfile 2.38 KB
一键复制 编辑 原始数据 按行查看 历史
花菜 提交于 2023-10-22 14:24 . ci(python-base): add ldap lib
FROM python:3.9-buster as Base
COPY requirements.txt .
ARG DEBIAN_REPO="deb.debian.org"
ARG PIP_INDEX_URL="https://pypi.org/simple"
RUN echo "deb http://$DEBIAN_REPO/debian/ buster main contrib non-free" > /etc/apt/sources.list && \
echo "deb-src http://$DEBIAN_REPO/debian/ buster main contrib non-free" >> /etc/apt/sources.list && \
echo "deb http://$DEBIAN_REPO/debian-security buster/updates main contrib non-free" >> /etc/apt/sources.list && \
echo "deb-src http://$DEBIAN_REPO/debian-security buster/updates main contrib non-free" >> /etc/apt/sources.list && \
echo "deb http://$DEBIAN_REPO/debian/ buster-updates main contrib non-free" >> /etc/apt/sources.list && \
echo "deb-src http://$DEBIAN_REPO/debian/ buster-updates main contrib non-free" >> /etc/apt/sources.list
RUN apt-get update && \
apt-get install -y default-libmysqlclient-dev python3-dev build-essential netcat-openbsd libpcre3-dev libldap2-dev libsasl2-dev && \
pip install setuptools==57.5.0 -i ${PIP_INDEX_URL} && \
pip install -r requirements.txt -i ${PIP_INDEX_URL} && \
apt-get remove -y python3-dev build-essential libpcre3-dev && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/*
FROM python:3.9-buster
ENV TZ=Asia/Shanghai
ARG DEBIAN_REPO="deb.debian.org"
RUN echo "deb http://$DEBIAN_REPO/debian/ buster main contrib non-free" > /etc/apt/sources.list && \
echo "deb-src http://$DEBIAN_REPO/debian/ buster main contrib non-free" >> /etc/apt/sources.list && \
echo "deb http://$DEBIAN_REPO/debian-security buster/updates main contrib non-free" >> /etc/apt/sources.list && \
echo "deb-src http://$DEBIAN_REPO/debian-security buster/updates main contrib non-free" >> /etc/apt/sources.list && \
echo "deb http://$DEBIAN_REPO/debian/ buster-updates main contrib non-free" >> /etc/apt/sources.list && \
echo "deb-src http://$DEBIAN_REPO/debian/ buster-updates main contrib non-free" >> /etc/apt/sources.list
RUN apt-get update && \
apt-get install -y default-libmysqlclient-dev tzdata && \
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
echo $TZ > /etc/timezone && \
rm -rf /var/lib/apt/lists/*
COPY --from=Base /usr/local/lib/python3.9/site-packages /usr/local/lib/python3.9/site-packages
WORKDIR /app
COPY . /app
RUN chmod +x /app/start.sh
RUN python manage.py collectstatic --settings=FasterRunner.settings.docker --no-input
ENTRYPOINT ["/app/start.sh"]
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化