Create Dockerfile
Browse files- Dockerfile +36 -0
Dockerfile
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# 1. 选择基础镜像
|
2 |
+
FROM ubuntu:22.04
|
3 |
+
|
4 |
+
# 2. 设置维护者信息
|
5 |
+
LABEL maintainer="[email protected]"
|
6 |
+
|
7 |
+
# 3. 更新包管理器并安装依赖项
|
8 |
+
RUN apt-get update && apt-get install -y \
|
9 |
+
curl \
|
10 |
+
git \
|
11 |
+
build-essential
|
12 |
+
|
13 |
+
# 4. 安装Node.js
|
14 |
+
RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash - \
|
15 |
+
&& apt-get install -y nodejs
|
16 |
+
|
17 |
+
# 5. 安装yarn
|
18 |
+
RUN npm install -g yarn
|
19 |
+
|
20 |
+
# 6. 克隆Electerm项目仓库
|
21 |
+
RUN git clone https://github.com/electerm/electerm.git /opt/electerm
|
22 |
+
|
23 |
+
# 7. 设置工作目录
|
24 |
+
WORKDIR /opt/electerm
|
25 |
+
|
26 |
+
# 8. 安装项目依赖
|
27 |
+
RUN yarn install
|
28 |
+
|
29 |
+
# 9. 构建项目
|
30 |
+
RUN yarn run release
|
31 |
+
|
32 |
+
# 10. 暴露端口(如果Electerm需要暴露端口)
|
33 |
+
EXPOSE 7860
|
34 |
+
|
35 |
+
# 11. 启动Electerm(此处需要具体运行命令,可以根据项目文档调整)
|
36 |
+
CMD ["yarn", "run", "start"]
|