init: first commit
This commit is contained in:
24
Dockerfile
Normal file
24
Dockerfile
Normal file
@@ -0,0 +1,24 @@
|
||||
FROM python:3.11-slim-bookworm
|
||||
|
||||
# 设置环境变量,确保 Python 输出为 UTF-8
|
||||
ENV PYTHONIOENCODING=utf-8
|
||||
ENV LANG C.UTF-8
|
||||
|
||||
# 设置工作目录
|
||||
WORKDIR /app
|
||||
|
||||
# 复制依赖文件并安装依赖
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# 复制所有的应用程序代码到工作目录
|
||||
COPY bot.py .
|
||||
|
||||
# 声明存储目录为一个卷
|
||||
# 这表明 /app/local_storage 路径下的数据应该被持久化
|
||||
# 注意:实际的路径将由 bot.py 中的 STORAGE_DIR 环境变量决定
|
||||
# 我们在这里声明默认值
|
||||
VOLUME /app/local_storage
|
||||
|
||||
|
||||
CMD ["python", "bot.py"]
|
||||
Reference in New Issue
Block a user