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
3d032a88
Commit
3d032a88
authored
Jul 24, 2025
by
zhangxingmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push
parent
faf16f94
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
Dockerfile
+13
-9
No files found.
Dockerfile
View file @
3d032a88
...
...
@@ -3,18 +3,18 @@ FROM node:14-alpine AS builder
# 设置工作目录
WORKDIR
/app
# 安装系统依赖(uni-app编译可能需要)
RUN
apk add
--no-cache
python3 make g++
# 替换Alpine源为国内镜像 + 安装系统依赖
RUN
sed
-i
's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g'
/etc/apk/repositories
\
&&
apk add
--no-cache
python3 make g++
# 复制包文件并设置镜像源
# 复制包文件并设置
npm
镜像源
COPY
package*.json ./
RUN
npm config
set
registry https://registry.npmmirror.com
&&
\
npm config
set
disturl https://npmmirror.com/dist
&&
\
npm config
set
sass_binary_site https://npmmirror.com/mirrors/node-sass/
&&
\
rm
-rf
node_modules package-lock.json
&&
\
npm cache clean
--force
RUN
npm config
set
registry https://registry.npmmirror.com
\
&&
npm config
set
disturl https://npmmirror.com/dist
\
&&
npm config
set
sass_binary_site https://npmmirror.com/mirrors/node-sass/
\
&&
npm cache clean
--force
# 安装依赖
# 安装依赖
(移除冗余的清理操作)
RUN
npm install
--legacy-peer-deps
# 复制源代码
...
...
@@ -25,6 +25,10 @@ RUN npm run build
# 生产阶段
FROM
nginx:1.21-alpine
# 替换生产阶段的Alpine源 (可选)
RUN
sed
-i
's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g'
/etc/apk/repositories
COPY
--from=builder /app/dist/build/h5 /usr/share/nginx/html
COPY
nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE
8333
...
...
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