Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-middle-front
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xingmin
yd-middle-front
Commits
ce74c2f7
Commit
ce74c2f7
authored
Sep 05, 2025
by
zhangxingmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
配置 test
parent
7b722871
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
10 deletions
+19
-10
Dockerfile
+13
-6
package.json
+6
-4
No files found.
Dockerfile
View file @
ce74c2f7
...
...
@@ -29,15 +29,22 @@ WORKDIR /app
# 复制包管理文件
COPY
package.json ./
# 安装项目依赖
# 1. 显式安装 esbuild 二进制
RUN
npm install @esbuild/linux-x64
--verbose
--registry
=
https://registry.npmmirror.com
# 2. 安装其他原生模块
RUN
npm install canvas@2.11.2
--verbose
--ignore-scripts
RUN
npm install sharp@0.32.6
--verbose
--ignore-scripts
# 3. 安装项目依赖(移除 --no-optional)
RUN
npm install
--verbose
--registry
=
https://registry.npmmirror.com
# 复制源码和环境配置文件
COPY
. .
# 确保环境文件被正确复制
COPY
.env.testelopment .env.testelopment
# 4. 验证 esbuild 安装
RUN
ls
-la
node_modules/esbuild/bin
&&
\
./node_modules/.bin/esbuild
--version
# 使用测试环境构建
# 复制源码并构建
COPY
. .
RUN
npm run build:test
# 生产阶段
...
...
package.json
View file @
ce74c2f7
...
...
@@ -7,10 +7,12 @@
"type"
:
"module"
,
"scripts"
:
{
"dev"
:
"vite"
,
"build:prod"
:
"vite build"
,
"build:test"
:
"vite build --mode testelopment"
,
"build:stage"
:
"vite build --mode staging"
,
"preview"
:
"vite preview"
"build"
:
"vite build"
,
"test"
:
"vite --mode=test"
,
"build:dev"
:
"vite build --mode=development"
,
"build:test"
:
"vite build --mode=test"
,
"preview"
:
"vite preview"
,
"report"
:
"npm run build --report"
},
"repository"
:
{
"type"
:
"git"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment