Spaces:
Sleeping
Sleeping
Create Dockerfile
Browse files- Dockerfile +34 -0
Dockerfile
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM node:22-slim
|
| 2 |
+
USER root
|
| 3 |
+
|
| 4 |
+
# 1. 安装基础工具
|
| 5 |
+
RUN apt-get update && apt-get install -y python3 python3-pip python3-full curl git sudo \
|
| 6 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 7 |
+
|
| 8 |
+
# 2. 安装 code-server|
|
| 9 |
+
RUN curl -fsSL https://code-server.dev/install.sh | sh
|
| 10 |
+
|
| 11 |
+
# 3. 安装 opencode
|
| 12 |
+
RUN curl -fsSL https://opencode.ai/install | bash
|
| 13 |
+
|
| 14 |
+
# 4. 安装 opencode
|
| 15 |
+
RUN curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
|
| 16 |
+
|
| 17 |
+
# 5. 安装 同步库
|
| 18 |
+
RUN pip3 install huggingface_hub --break-system-packages
|
| 19 |
+
|
| 20 |
+
# 6. 预设关键目录
|
| 21 |
+
RUN mkdir -p /root/project/data /root/project/config
|
| 22 |
+
|
| 23 |
+
# 7. 脚本进场
|
| 24 |
+
COPY sync.py /sync.py
|
| 25 |
+
COPY entrypoint.sh /entrypoint.sh
|
| 26 |
+
RUN chmod +x /entrypoint.sh
|
| 27 |
+
|
| 28 |
+
# 骚操作:配置快捷命令别名
|
| 29 |
+
RUN echo "alias sync='PYTHONPATH=/ python3 -c "from sync import upload_all; upload_all()"'" >> /root/.bashrc && \
|
| 30 |
+
echo "alias restore='PYTHONPATH=/ python3 -c "from sync import download_all; download_all()"'" >> /root/.bashrc
|
| 31 |
+
|
| 32 |
+
ENV PORT=7860
|
| 33 |
+
EXPOSE 7860
|
| 34 |
+
CMD ["/bin/bash", "/entrypoint.sh"]
|