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
f736895c
Commit
f736895c
authored
Aug 04, 2025
by
zhangxingmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push
parent
f39e8188
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
8 deletions
+28
-8
Dockerfile
+28
-8
No files found.
Dockerfile
View file @
f736895c
# 使用 N
ginx 基础镜像
# 使用 N
ode.js 基础镜像(包含完整工具链)
FROM
n
ginx:1.25-alpine
FROM
n
ode:20-alpine AS builder
# 设置时区
# 设置时区
ENV
TZ=Asia/Shanghai
ENV
TZ=Asia/Shanghai
RUN
ln
-snf
/usr/share/zoneinfo/
$TZ
/etc/localtime
&&
echo
$TZ
>
/etc/timezone
RUN
ln
-snf
/usr/share/zoneinfo/
$TZ
/etc/localtime
&&
echo
$TZ
>
/etc/timezone
# 使用阿里云镜像源
替换 Alpine 官方源
# 使用阿里云镜像源
RUN
echo
"https://mirrors.aliyun.com/alpine/v3.19/main"
>
/etc/apk/repositories
&&
\
RUN
echo
"https://mirrors.aliyun.com/alpine/v3.19/main"
>
/etc/apk/repositories
&&
\
echo
"https://mirrors.aliyun.com/alpine/v3.19/community"
>>
/etc/apk/repositories
echo
"https://mirrors.aliyun.com/alpine/v3.19/community"
>>
/etc/apk/repositories
# 安装
Node.js 和基本依赖(使用阿里云源加速)
# 安装
基本依赖
RUN
apk add
--no-cache
\
RUN
apk add
--no-cache
\
nodejs
\
npm
\
curl
\
curl
\
bash
bash
\
# 安装 Qt 运行环境
qt5-qtbase \
qt5-qtsvg \
qt5-qtwebsockets \
# 安装图形库依赖
gtk+3.0 \
libx11 \
libxrandr \
libxcomposite \
libxdamage \
libxext \
# ICU 国际化支持
icu
# 设置工作目录
# 设置工作目录
WORKDIR
/app
WORKDIR
/app
...
@@ -22,11 +33,20 @@ WORKDIR /app
...
@@ -22,11 +33,20 @@ WORKDIR /app
# 复制项目文件
# 复制项目文件
COPY
. .
COPY
. .
# 配置 npm 镜像源
为淘宝源
# 配置 npm 镜像源
RUN
npm config
set
registry https://registry.npmmirror.com
RUN
npm config
set
registry https://registry.npmmirror.com
# 第二阶段:运行环境
FROM
nginx:1.25-alpine
# 复制自定义 Nginx 配置
# 复制自定义 Nginx 配置
COPY
nginx.conf /etc/nginx/conf.d/app.conf
COPY
nginx.conf /etc/nginx/conf.d/app.conf
# 从构建阶段复制构建产物
COPY
--from=builder /app/dist /usr/share/nginx/html
# 暴露端口
# 暴露端口
EXPOSE
8333
EXPOSE
8333
# 启动 Nginx
CMD
["nginx", "-g", "daemon off;"]
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