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
bb9120bf
Commit
bb9120bf
authored
Sep 05, 2025
by
zhangxingmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push
parent
25e97d61
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
15 deletions
+8
-15
Dockerfile
+8
-15
No files found.
Dockerfile
View file @
bb9120bf
# 使用
更新的
基础镜像 (Debian bullseye)
# 使用
Node.js 18
基础镜像 (Debian bullseye)
FROM
docker.m.daocloud.io/library/node:1
6
-bullseye AS build
FROM
docker.m.daocloud.io/library/node:1
8
-bullseye AS build
# 设置环境变量
# 设置环境变量
ENV
npm_config_canvas_binary_host_mirror="https://npmmirror.com/mirrors/canvas"
ENV
npm_config_canvas_binary_host_mirror="https://npmmirror.com/mirrors/canvas"
...
@@ -29,22 +29,15 @@ WORKDIR /app
...
@@ -29,22 +29,15 @@ WORKDIR /app
# 复制包管理文件
# 复制包管理文件
COPY
package.json ./
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
RUN
npm install
--verbose
--registry
=
https://registry.npmmirror.com
# 4. 验证 esbuild 安装
# 复制源码和环境配置文件
RUN
ls
-la
node_modules/esbuild/bin
&&
\
./node_modules/.bin/esbuild
--version
# 复制源码并构建
COPY
. .
COPY
. .
# 确保环境文件被正确复制
COPY
.env.testelopment .env.testelopment
# 使用测试环境构建
RUN
npm run build:test
RUN
npm run build:test
# 生产阶段
# 生产阶段
...
...
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