-
Notifications
You must be signed in to change notification settings - Fork 65
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
2 changed files
with
47 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# 忽略 node_modules 目录 | ||
node_modules | ||
|
||
# 忽略 .nuxt 目录 | ||
.nuxt | ||
|
||
# 忽略日志文件 | ||
*.log | ||
|
||
# 忽略操作系统生成的文件 | ||
.DS_Store | ||
Thumbs.db | ||
|
||
# 忽略编辑器生成的文件 | ||
.vscode | ||
.idea | ||
*.swp | ||
*.swo | ||
|
||
# 忽略 git 相关文件 | ||
.git | ||
.gitignore | ||
|
||
# 忽略测试和 CI 相关文件 | ||
tests/ | ||
.travis.yml |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# 设置基础镜像 | ||
ARG NODE_VERSION=18.14.2 | ||
FROM node:${NODE_VERSION}-slim as base | ||
ARG PORT=3000 | ||
ENV NODE_ENV=production | ||
WORKDIR /src | ||
|
||
# 构建阶段 | ||
FROM base as build | ||
COPY --link package.json pnpm-lock.yaml ./ | ||
RUN npm install -g pnpm | ||
RUN pnpm install --production=false | ||
COPY --link . . | ||
RUN pnpm run build | ||
# RUN pnpm prune | ||
|
||
# 运行阶段 | ||
FROM base | ||
ENV PORT=$PORT | ||
COPY --from=build /src/.output /src/.output | ||
CMD ["node", ".output/server/index.mjs"] |