定时同步数据库功能

This commit is contained in:
2025-01-22 08:58:03 +08:00
parent b6de86bd63
commit c250c6afb9
8 changed files with 549 additions and 0 deletions

26
Dockerfile Normal file
View File

@@ -0,0 +1,26 @@
# 使用本地python镜像作为基础镜像
FROM python:3.10.15-bookworm
# 设置工作目录
WORKDIR /home/ucloud
# 设置环境变量
ENV PYTHONUNBUFFERED=1 \
# 设置时区
TZ=Asia/Shanghai \
# 设置pip镜像地址加快安装速度
PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple
# 安装依赖
COPY requirements.txt /home/ucloud/requirements.txt
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone \
&& pip install --no-cache-dir -r requirements.txt
# 将当前目录内容复制到容器的工作目录内
COPY . /home/ucloud
# 暴露端口
# EXPOSE 8081
# 运行python脚本具体脚本在命令行或docker-compose.yml文件中定义
ENTRYPOINT ["python"]