Spaces:
Sleeping
Sleeping
| # 升级到 24.04,原生支持 Java 21 | |
| FROM ubuntu:24.04 | |
| # 防止安装软件时卡在时区选择 | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| # 安装 Java 21 和其他依赖 | |
| RUN apt-get update && apt-get install -y \ | |
| openjdk-21-jre-headless \ | |
| python3 python3-pip \ | |
| wget curl jq \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # 在 Ubuntu 24.04 中,必须加 --break-system-packages 才能全局安装 pip 库 | |
| RUN pip3 install --upgrade huggingface_hub flask mcrcon transformers requests --break-system-packages | |
| WORKDIR /mcserver | |
| # 1. 下载后台守护进程 (命名为 playitd) | |
| RUN wget -q -O playitd https://github.com/playit-cloud/playit-agent/releases/latest/download/playit-linux-amd64 \ | |
| && chmod +x playitd | |
| # 2. 下载命令行客户端 (命名为 playit) | |
| RUN wget -q -O playit https://github.com/playit-cloud/playit-agent/releases/latest/download/playit-cli-linux-amd64 \ | |
| && chmod +x playit | |
| # 复制代码进去 | |
| COPY entrypoint.sh backup.py web_console.py ./ | |
| RUN chmod +x entrypoint.sh | |
| # 暴露给 HF 的端口 | |
| EXPOSE 7860 | |
| CMD ["./entrypoint.sh"] |