parent
114b44d401
commit
453970fc33
@ -1,15 +1,15 @@
|
||||
FROM python:3.11
|
||||
ENV PYTHONUNBUFFERED 1
|
||||
WORKDIR /code/djangoblog/
|
||||
RUN apt-get update && \
|
||||
apt-get install default-libmysqlclient-dev gettext -y && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
ADD requirements.txt requirements.txt
|
||||
RUN pip install --upgrade pip && \
|
||||
pip install --no-cache-dir -r requirements.txt && \
|
||||
pip install --no-cache-dir gunicorn[gevent] && \
|
||||
pip cache purge
|
||||
ENV PYTHONUNBUFFERED 1 # 设置Python无缓冲模式
|
||||
WORKDIR /code/djangoblog/ # 设置工作目录
|
||||
RUN apt-get update && \\
|
||||
apt-get install default-libmysqlclient-dev gettext -y && \\ # 安装MySQL客户端和gettext
|
||||
rm -rf /var/lib/apt/lists/* # 清理APT缓存
|
||||
ADD requirements.txt requirements.txt # 添加依赖文件
|
||||
RUN pip install --upgrade pip && \\
|
||||
pip install --no-cache-dir -r requirements.txt && \\ # 安装Python依赖
|
||||
pip install --no-cache-dir gunicorn[gevent] && \\ # 安装Gunicorn服务器
|
||||
pip cache purge # 清理pip缓存
|
||||
|
||||
ADD . .
|
||||
RUN chmod +x /code/djangoblog/deploy/entrypoint.sh
|
||||
ENTRYPOINT ["/code/djangoblog/deploy/entrypoint.sh"]
|
||||
ADD . . # 添加项目代码
|
||||
RUN chmod +x /code/djangoblog/deploy/entrypoint.sh # 给入口脚本添加执行权限
|
||||
ENTRYPOINT ["/code/djangoblog/deploy/entrypoint.sh"] # 设置入口点脚本
|
||||
Loading…
Reference in new issue