定时同步数据库功能
This commit is contained in:
26
Dockerfile
Normal file
26
Dockerfile
Normal 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"]
|
||||
Reference in New Issue
Block a user