Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qg-dockerfiles
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
QA
qg-dockerfiles
Commits
c92eb63b
Commit
c92eb63b
authored
Jun 21, 2019
by
kewei.jia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加健康检查
parent
06e2d14e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
0 deletions
+28
-0
Dockerfile
tke/nodejs/Dockerfile
+1
-0
readyCheck.sh
tke/nodejs/readyCheck.sh
+27
-0
No files found.
tke/nodejs/Dockerfile
View file @
c92eb63b
...
@@ -9,6 +9,7 @@ FROM ccr.ccs.tencentyun.com/qa-base/node10
...
@@ -9,6 +9,7 @@ FROM ccr.ccs.tencentyun.com/qa-base/node10
WORKDIR
/home/quant_group
WORKDIR
/home/quant_group
COPY
--from=builder /home/quant_group/node_modules ./node_modules
COPY
--from=builder /home/quant_group/node_modules ./node_modules
COPY
*.tgz docker-entrypoint.sh ./
COPY
*.tgz docker-entrypoint.sh ./
COPY
readyCheck.sh .
EXPOSE
80
EXPOSE
80
CMD
["sh", "docker-entrypoint.sh"]
CMD
["sh", "docker-entrypoint.sh"]
tke/nodejs/readyCheck.sh
0 → 100755
View file @
c92eb63b
#!/bin/bash
# 就绪检查, 返回0表示就绪
# 请求tech/health/check
# status 返回5xx or 000 启动中(未就绪)
# 返回404 未实现该接口,认为就绪
# 返回2xx, 就绪
# 其他, 就绪
statusCode
=
`
curl
-I
-o
/dev/null
-s
-w
%
{
http_code
}
http://localhost/teach/health/check
`
echo
"statusCode:
${
statusCode
}
"
statusCodeFirst
=
"
${
statusCode
:0:1
}
"
echo
"statusCodeFirst:
${
statusCodeFirst
}
"
READY
=
0
UNREADY
=
1
if
[
${
statusCodeFirst
}
=
"5"
-o
${
statusCodeFirst
}
=
"0"
]
then
exit
${
UNREADY
}
fi
exit
${
READY
}
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