Upload Dockerfile
Browse files- Dockerfile +8 -7
Dockerfile
CHANGED
|
@@ -6,20 +6,21 @@ RUN apk add --no-cache bash curl
|
|
| 6 |
# 设置工作目录
|
| 7 |
WORKDIR /app
|
| 8 |
|
| 9 |
-
#
|
| 10 |
-
COPY
|
| 11 |
-
COPY frontend/package*.json ./frontend/
|
| 12 |
|
| 13 |
-
#
|
| 14 |
-
|
| 15 |
-
RUN npm install --omit=dev
|
| 16 |
|
| 17 |
# 安装前端依赖并构建
|
| 18 |
WORKDIR /app/frontend
|
| 19 |
RUN npm install
|
| 20 |
-
COPY frontend/ ./
|
| 21 |
RUN npm run build
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
# 复制后端代码
|
| 24 |
WORKDIR /app
|
| 25 |
COPY backend/ ./backend/
|
|
|
|
| 6 |
# 设置工作目录
|
| 7 |
WORKDIR /app
|
| 8 |
|
| 9 |
+
# 复制前端所有文件(包括配置文件)
|
| 10 |
+
COPY frontend/ ./frontend/
|
|
|
|
| 11 |
|
| 12 |
+
# 复制后端package.json
|
| 13 |
+
COPY backend/package*.json ./backend/
|
|
|
|
| 14 |
|
| 15 |
# 安装前端依赖并构建
|
| 16 |
WORKDIR /app/frontend
|
| 17 |
RUN npm install
|
|
|
|
| 18 |
RUN npm run build
|
| 19 |
|
| 20 |
+
# 安装后端依赖
|
| 21 |
+
WORKDIR /app/backend
|
| 22 |
+
RUN npm install --omit=dev
|
| 23 |
+
|
| 24 |
# 复制后端代码
|
| 25 |
WORKDIR /app
|
| 26 |
COPY backend/ ./backend/
|