Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
three.js-template
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
eazy-template
three.js-template
Commits
7886d148
Commit
7886d148
authored
Sep 17, 2025
by
xiezhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
简化 Dockerfile
- 移除复杂的用户权限设置 - 移除健康检查配置 - 移除启动脚本依赖 - 保留核心功能:依赖安装、构建、启动 - 从42行简化到21行
parent
470ac4d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
23 deletions
+3
-23
Dockerfile
Dockerfile
+3
-23
No files found.
Dockerfile
View file @
7886d148
# 使用 Node.js 22 官方镜像作为基础镜像
FROM
hb.eazytec-cloud.com/eazytec/eazydevelop-node:ubuntu22.04-node22-latest
# 设置工作目录
WORKDIR
/app
# 设置环境变量
ENV
NODE_ENV=production
ENV
PORT=${APP_PORT_1:-8000}
# 复制 package.json 和 package-lock.json(如果存在)
# 复制依赖文件
COPY
package*.json ./
# 安装依赖
...
...
@@ -17,25 +11,11 @@ RUN npm ci
# 复制应用代码
COPY
. .
# 创建非 root 用户
RUN
addgroup
-g
1001
-S
nodejs
RUN
adduser
-S
threejs
-u
1001
# 更改文件所有权
RUN
chown
-R
threejs:nodejs /app
USER
threejs
# 构建应用
RUN
npm run build
# 暴露端口
EXPOSE
${APP_PORT_1:-8000}
# 设置启动脚本
COPY
docker-entrypoint.sh /usr/local/bin/
RUN
chmod
+x /usr/local/bin/docker-entrypoint.sh
# 健康检查
HEALTHCHECK
--interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD curl -f http://localhost:${APP_PORT_1:-8000} || exit 1
# 启动应用
ENTRYPOINT
["docker-entrypoint.sh"]
CMD
["npm", "run", "serve"]
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