We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e3a4f79 + 615ee28 commit 3eff944Copy full SHA for 3eff944
Dockerfile
@@ -1,18 +1,16 @@
1
-# 阶段一:构建阶段
2
-FROM node:18.17.0 AS build
+# 使用官方Node.js 18镜像(包含基于Ubuntu的节点环境)
+FROM node:18.17.0
3
+
4
+# 创建工作目录
5
WORKDIR /usr/src/app
-COPY package*.json ./
-RUN npm install
6
7
+# 复制当前目录下的所有文件到工作目录
8
COPY . .
-RUN npm run build && \
- # 清理不必要的文件
9
- rm -rf node_modules
10
11
-# 阶段二:最终运行时镜像
12
-FROM node:18.17.0
13
-WORKDIR /usr/src/app
14
-COPY --from=build /usr/src/app/dist ./dist
15
RUN apt-get update && \
16
apt-get install -y curl software-properties-common ffmpeg && \
+ npm install && \
17
npm install wx-voice -g
18
-CMD ["sh", "-c", "wx-voice compile && npm run start"]
+# 启动应用
+CMD ["sh", "-c", "wx-voice compile && npm run start"]
0 commit comments