Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CFFP-HB
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
0
Merge Requests
0
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
Chao Sun
CFFP-HB
Commits
ffc40ee0
Commit
ffc40ee0
authored
Jul 24, 2025
by
zhangxingmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push
parent
f81f011a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
Dockerfile
+5
-6
No files found.
Dockerfile
View file @
ffc40ee0
# 注意:此方案需要在Docker中安装HBuilderX CLI,步骤较特殊
FROM
node:16-alpine AS builder
WORKDIR
/app
# 安装HBuilderX
CLI(关键:使用官方提供的CLI工具,而非npm包
)
# 安装HBuilderX
(使用最新稳定版链接,避免alpha版过期
)
RUN
apk add
--no-cache
wget unzip
\
&&
wget https://download.dcloud.net.cn/hbuilderx/
alpha/HBuilderX.3.99.20231011
.full.zip
-O
hbx.zip
\
&&
wget https://download.dcloud.net.cn/hbuilderx/
latest/HBuilderX.4.0.14.20240425
.full.zip
-O
hbx.zip
\
&&
unzip hbx.zip
-d
/opt/hbuilderx
\
&&
chmod +x /opt/hbuilderx/cli
&&
chmod +x /opt/hbuilderx/cli
# 确保cli可执行
# 复制项目文件
(假设项目是HBuilderX创建的标准结构)
# 复制项目文件
COPY
. .
# 使用HBuilderX CLI构建H5项目
(避开npm依赖)
# 使用HBuilderX CLI构建H5项目
RUN
/opt/hbuilderx/cli publish
--platform
h5
--project
.
--outDir
dist
# 生产环境
...
...
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