mirror of
https://github.com/yshtcn/DiaryAssistant_bot.git
synced 2025-12-16 11:10:24 +08:00
docker打包文件
This commit is contained in:
parent
8a9207566a
commit
199a5eb92a
20
Dockerfile
Normal file
20
Dockerfile
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# 使用官方的 Python 3.11 镜像作为基础镜像
|
||||||
|
FROM python:3.11-slim
|
||||||
|
|
||||||
|
# 设置工作目录
|
||||||
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
|
# 将当前目录下的所有文件复制到镜像中的工作目录
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# 创建/data目录用于存储生成的文件
|
||||||
|
RUN mkdir /data
|
||||||
|
|
||||||
|
# 定义环境变量 PIP_INDEX_URL 并设置其默认值为清华大学的更新源
|
||||||
|
ENV PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple
|
||||||
|
|
||||||
|
# 安装 Python 依赖
|
||||||
|
RUN pip install --no-cache-dir -i $PIP_INDEX_URL requests
|
||||||
|
|
||||||
|
# 设置容器启动后执行的命令
|
||||||
|
CMD [ "python", "./Diary Assistant.py" ]
|
||||||
Loading…
x
Reference in New Issue
Block a user