Spaces:
Sleeping
Sleeping
| 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"] |