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
71d49387
Commit
71d49387
authored
Aug 04, 2025
by
zhangxingmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push
parent
f736895c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
4 deletions
+25
-4
Dockerfile
+25
-4
No files found.
Dockerfile
View file @
71d49387
# 使用 Node.js 基础镜像
(包含完整工具链)
# 使用 Node.js 基础镜像
FROM
node:20-alpine AS builder
FROM
node:20-alpine AS builder
# 设置时区
# 设置时区
...
@@ -13,18 +13,15 @@ RUN echo "https://mirrors.aliyun.com/alpine/v3.19/main" > /etc/apk/repositories
...
@@ -13,18 +13,15 @@ RUN echo "https://mirrors.aliyun.com/alpine/v3.19/main" > /etc/apk/repositories
RUN
apk add
--no-cache
\
RUN
apk add
--no-cache
\
curl
\
curl
\
bash
\
bash
\
# 安装 Qt 运行环境
qt5-qtbase
\
qt5-qtbase
\
qt5-qtsvg
\
qt5-qtsvg
\
qt5-qtwebsockets
\
qt5-qtwebsockets
\
# 安装图形库依赖
gtk+3.0
\
gtk+3.0
\
libx11
\
libx11
\
libxrandr
\
libxrandr
\
libxcomposite
\
libxcomposite
\
libxdamage
\
libxdamage
\
libxext
\
libxext
\
# ICU 国际化支持
icu
icu
# 设置工作目录
# 设置工作目录
...
@@ -36,9 +33,33 @@ COPY . .
...
@@ -36,9 +33,33 @@ COPY . .
# 配置 npm 镜像源
# 配置 npm 镜像源
RUN
npm config
set
registry https://registry.npmmirror.com
RUN
npm config
set
registry https://registry.npmmirror.com
# 安装项目依赖
RUN
npm install
--no-audit
# 复制 HBuilderX 到镜像中
COPY
--from=hbuilder-context /opt/HBuilderX /opt/HBuilderX
# 修复权限
RUN
chmod 755 /opt/HBuilderX/cli
&&
\
chmod 755 /opt/HBuilderX/HBuilderX
&&
\
find /opt/HBuilderX
-name
"lib*.so*"
-exec
chmod 755
{}
\;
# 设置 Qt 库路径
ENV
LD_LIBRARY_PATH=/opt/HBuilderX:$LD_LIBRARY_PATH
# 登录和构建项目
ARG
HB_USERNAME
ARG
HB_PASSWORD
RUN
/opt/HBuilderX/cli user login
--username
"
$HB_USERNAME
"
--password
"
$HB_PASSWORD
"
&&
\
/opt/HBuilderX/cli publish
--platform
h5
--project
.
--output
dist
# 第二阶段:运行环境
# 第二阶段:运行环境
FROM
nginx:1.25-alpine
FROM
nginx:1.25-alpine
# 设置时区
ENV
TZ=Asia/Shanghai
RUN
ln
-snf
/usr/share/zoneinfo/
$TZ
/etc/localtime
&&
echo
$TZ
>
/etc/timezone
# 复制自定义 Nginx 配置
# 复制自定义 Nginx 配置
COPY
nginx.conf /etc/nginx/conf.d/app.conf
COPY
nginx.conf /etc/nginx/conf.d/app.conf
...
...
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