-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
3 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,10 @@ | ||
# 构建阶段 | ||
FROM node:18-alpine AS builder | ||
|
||
WORKDIR /app | ||
|
||
COPY package*.json ./ | ||
RUN npm ci | ||
|
||
COPY . . | ||
RUN npm run build | ||
|
||
# 生产阶段 | ||
FROM node:18-alpine | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=builder /app/.next /app/.next | ||
COPY --from=builder /app/node_modules /app/node_modules | ||
|
||
ENV NODE_ENV=production | ||
COPY . . | ||
RUN npm install && npm run build | ||
|
||
EXPOSE 3000 | ||
|
||
CMD ["next", "start"] | ||
CMD [ "npm", "run", "start" ] |