52496a27f51a commited on
Commit
85c8b85
·
verified ·
1 Parent(s): b94cd85

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +30 -0
Dockerfile ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:22.04
2
+ ENV TZ=Asia/Shanghai
3
+ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
4
+ echo $TZ > /etc/timezone
5
+ ENV DEBIAN_FRONTEND=noninteractive
6
+ # 安装必要的软件
7
+ RUN apt-get update && \
8
+ apt-get install -y git python3 python3-pip tzdata && \
9
+ rm -rf /var/lib/apt/lists/*
10
+
11
+ # 设置工作目录
12
+ WORKDIR /zmal
13
+
14
+ # 克隆项目
15
+ RUN git clone https://github.com/kmizmal/sleepy.git
16
+
17
+ # 进入项目目录
18
+ WORKDIR /zmal/sleepy
19
+
20
+ # 安装 Python 依赖
21
+ RUN pip install --no-cache-dir -r requirements.txt
22
+
23
+ # 复制配置文件(如果构建上下文中存在该文件)
24
+ COPY config.example.jsonc config.json
25
+ RUN chmod -R 777 /zmal/sleepy
26
+ # 暴露端口
27
+ EXPOSE 7860
28
+
29
+ # 运行应用
30
+ CMD ["python3", "server.py"]