Update Dockerfile
Browse files- Dockerfile +24 -38
Dockerfile
CHANGED
|
@@ -1,49 +1,35 @@
|
|
| 1 |
-
FROM ubuntu:22.04
|
| 2 |
|
| 3 |
# 设置工作目录
|
| 4 |
-
WORKDIR /app
|
| 5 |
-
|
| 6 |
-
# 安装
|
| 7 |
-
RUN apt-get update && apt-get install -y \
|
| 8 |
-
git \
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
# 安装 OpenClaw 全局 CLI
|
| 19 |
-
RUN npm install -g openclaw
|
| 20 |
|
| 21 |
# 克隆 Edict 仓库
|
| 22 |
-
RUN git clone https://github.com/cft0808/edict.git /app/edict
|
| 23 |
|
| 24 |
-
WORKDIR /app/edict
|
| 25 |
|
| 26 |
# 执行安装脚本
|
| 27 |
-
RUN chmod +x install.sh && ./install.sh
|
| 28 |
|
| 29 |
# 创建启动脚本
|
| 30 |
-
RUN echo '#!/bin/bash\n\
|
| 31 |
-
cd /app/edict\n\
|
| 32 |
-
\n\
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
LOOP_PID=$!\n\
|
| 36 |
-
\n\
|
| 37 |
-
# 启动看板服务器(前台)\n\
|
| 38 |
-
python3 dashboard/server.py &\n\
|
| 39 |
-
SERVER_PID=$!\n\
|
| 40 |
-
\n\
|
| 41 |
-
# 等待信号\n\
|
| 42 |
-
wait $SERVER_PID\n\
|
| 43 |
-
' > /app/start.sh && chmod +x /app/start.sh
|
| 44 |
-
|
| 45 |
-
# 暴露端口
|
| 46 |
-
EXPOSE 7891
|
| 47 |
|
| 48 |
-
|
|
|
|
| 49 |
CMD ["/app/start.sh"]
|
|
|
|
| 1 |
+
FROM nodesource/node:20-ubuntu-22.04 nodesource/node:20-ubuntu-22.04
|
| 2 |
|
| 3 |
# 设置工作目录
|
| 4 |
+
WORKDIR /app /app
|
| 5 |
+
|
| 6 |
+
# 安装 Python 和其他依赖
|
| 7 |
+
RUN apt-get update && apt-get install -y \ apt-get update && apt-get install -y \
|
| 8 |
+
git \ git \
|
| 9 |
+
python3 \ python3 \
|
| 10 |
+
python3-pip \ python3-pip \
|
| 11 |
+
python3-venv \ python3-venv \
|
| 12 |
+
bash \ bash \
|
| 13 |
+
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
|
| 14 |
+
|
| 15 |
+
# 安装 OpenClaw
|
| 16 |
+
RUN npm install -g openclaw npm install -g openclaw
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
# 克隆 Edict 仓库
|
| 19 |
+
RUN git clone https://github.com/cft0808/edict.git /app/edict git clone https://github.com/cft0808/edict.git /app/edict
|
| 20 |
|
| 21 |
+
WORKDIR /app/edict /app/edict
|
| 22 |
|
| 23 |
# 执行安装脚本
|
| 24 |
+
RUN chmod +x install.sh && ./install.sh chmod +x install.sh && ./install.sh
|
| 25 |
|
| 26 |
# 创建启动脚本
|
| 27 |
+
RUN echo echo echo echo '#!/bin/bash\n\\
|
| 28 |
+
cd /app/edict\n\cd /app/edict\n\
|
| 29 |
+
bash scripts/run_loop.sh &\n\bash scripts/run_loop.sh &\n\
|
| 30 |
+
python3 dashboard/server.py\n\python3 dashboard/server.py\n\
|
| 31 |
+
' > /app/start.sh && chmod +x /app/start.sh' > /app/start.sh && chmod +x /app/start.sh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
+
EXPOSE 7891
|
| 34 |
+
ENV PORT=7891
|
| 35 |
CMD ["/app/start.sh"]
|