Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
sutpc
/
heatmap
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit f56393de
authored
Nov 04, 2026
by
Administrator
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Update Dockerfile,优化构建速度
1 parent
5b138bcf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
14 deletions
Dockerfile
Dockerfile
View file @
f56393d
...
@@ -4,7 +4,10 @@
...
@@ -4,7 +4,10 @@
# ---- 构建前端 ----
# ---- 构建前端 ----
FROM
harbortest.glsx.com.cn/node/node:22.21.1-alpine3.21 AS builder
FROM
harbortest.glsx.com.cn/node/node:22.21.1-alpine3.21 AS builder
WORKDIR
/app
WORKDIR
/app
ENV
NODE_ENV=production
ENV
SERVER_PORT=8787
RUN
corepack
enable
RUN
corepack
enable
RUN
npm config
set
registry https://registry.npmmirror.com/
COPY . .
COPY . .
RUN
pnpm install
RUN
pnpm install
...
@@ -13,20 +16,20 @@ RUN pnpm install
...
@@ -13,20 +16,20 @@ RUN pnpm install
RUN
pnpm build
RUN
pnpm build
# ---- 运行 ----
# ---- 运行 ----
FROM
harbortest.glsx.com.cn/node/node:22.21.1-alpine3.21 AS runner
#
FROM harbortest.glsx.com.cn/node/node:22.21.1-alpine3.21 AS runner
WORKDIR
/app
#
WORKDIR /app
ENV
NODE_ENV=production
#
ENV NODE_ENV=production
ENV
SERVER_PORT=8787
#
ENV SERVER_PORT=8787
RUN
corepack
enable
#
RUN corepack enable
# 只拷运行所需源码与前端产物,重新解析依赖(含 tsx 以运行 .ts)
#
#
只拷运行所需源码与前端产物,重新解析依赖(含 tsx 以运行 .ts)
COPY pnpm-lock.yaml package.json pnpm-workspace.yaml ./
#
COPY pnpm-lock.yaml package.json pnpm-workspace.yaml ./
COPY packages ./packages
#
COPY packages ./packages
COPY src ./src
#
COPY src ./src
COPY public ./public
#
COPY public ./public
COPY index.html vite.config.ts tsconfig.json tsconfig.node.json ./
#
COPY index.html vite.config.ts tsconfig.json tsconfig.node.json ./
COPY --from=builder /app/dist ./dist
#
COPY --from=builder /app/dist ./dist
RUN
pnpm install
#
RUN pnpm install
# 账号目录挂为 volume(见 docker-compose.yml),避免写入镜像层
# 账号目录挂为 volume(见 docker-compose.yml),避免写入镜像层
VOLUME
["/app/packages/server/data"]
VOLUME
["/app/packages/server/data"]
EXPOSE
8787
EXPOSE
8787
CMD
["pnpm", "--filter", "@hm/server", "start"]
CMD
["pnpm", "--filter", "@hm/server", "start"]
\ No newline at end of file
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment