File size: 726 Bytes
85c8b85
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM ubuntu:22.04
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
    echo $TZ > /etc/timezone
ENV DEBIAN_FRONTEND=noninteractive
# 安装必要的软件
RUN apt-get update && \
    apt-get install -y git python3 python3-pip tzdata && \
    rm -rf /var/lib/apt/lists/*

# 设置工作目录
WORKDIR /zmal

# 克隆项目
RUN git clone https://github.com/kmizmal/sleepy.git

# 进入项目目录
WORKDIR /zmal/sleepy

# 安装 Python 依赖
RUN pip install --no-cache-dir -r requirements.txt

# 复制配置文件(如果构建上下文中存在该文件)
COPY config.example.jsonc config.json
RUN chmod -R 777 /zmal/sleepy
# 暴露端口
EXPOSE 7860

# 运行应用
CMD ["python3", "server.py"]