Skip to content

Commit 3eff944

Browse files
authored
Merge pull request #6 from atorber/dev
Update Dockerfile
2 parents e3a4f79 + 615ee28 commit 3eff944

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

Dockerfile

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
1-
# 阶段一:构建阶段
2-
FROM node:18.17.0 AS build
1+
# 使用官方Node.js 18镜像(包含基于Ubuntu的节点环境)
2+
FROM node:18.17.0
3+
4+
# 创建工作目录
35
WORKDIR /usr/src/app
4-
COPY package*.json ./
5-
RUN npm install
6+
7+
# 复制当前目录下的所有文件到工作目录
68
COPY . .
7-
RUN npm run build && \
8-
# 清理不必要的文件
9-
rm -rf node_modules
109

11-
# 阶段二:最终运行时镜像
12-
FROM node:18.17.0
13-
WORKDIR /usr/src/app
14-
COPY --from=build /usr/src/app/dist ./dist
1510
RUN apt-get update && \
1611
apt-get install -y curl software-properties-common ffmpeg && \
12+
npm install && \
1713
npm install wx-voice -g
18-
CMD ["sh", "-c", "wx-voice compile && npm run start"]
14+
15+
# 启动应用
16+
CMD ["sh", "-c", "wx-voice compile && npm run start"]

0 commit comments

Comments
 (0)