Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
hsz1273327 committed Dec 5, 2020
1 parent 9334df3 commit 09096ca
Show file tree
Hide file tree
Showing 8 changed files with 941 additions and 2 deletions.
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# 空内容分支
# gh-oauth-server

用于初始化一个例子分支
[gitment](https://github.com/imsun/gitment)依赖的中介服务.用于

## 特性

+ 这个image包含对linux-arm64,linux-amd64和linux-arm/v7的支持.

+ 支持健康检测

+ 默认端口在3000

```sh
$ npm start
```
10 changes: 10 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
docker buildx build --load --platform=linux/arm64 -t hsz1273327/gh-oauth-server:arm64-0.0.2 -t hsz1273327/gh-oauth-server:arm64-latest .
docker buildx build --load --platform=linux/amd64 -t hsz1273327/gh-oauth-server:amd64-0.0.2 -t hsz1273327/gh-oauth-server:amd64-latest .
docker buildx build --load --platform=linux/arm/v7 -t hsz1273327/gh-oauth-server:armv7-0.0.2 -t hsz1273327/gh-oauth-server:armv7-latest .
docker push hsz1273327/gh-oauth-server

docker manifest create --amend hsz1273327/gh-oauth-server:0.0.2 hsz1273327/gh-oauth-server:arm64-0.0.2 hsz1273327/gh-oauth-server:amd64-0.0.2 hsz1273327/gh-oauth-server:armv7-0.0.2
docker manifest push --purge hsz1273327/gh-oauth-server:0.0.2

docker manifest create --amend hsz1273327/gh-oauth-server:latest hsz1273327/gh-oauth-server:arm64-latest hsz1273327/gh-oauth-server:amd64-latest hsz1273327/gh-oauth-server:armv7-latest
docker manifest push --purge hsz1273327/gh-oauth-server:latest
10 changes: 10 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
docker buildx build --load --platform=linux/arm64 -t hsz1273327/gh-oauth-server:arm64-0.0.2 -t hsz1273327/gh-oauth-server:arm64-latest .
docker buildx build --load --platform=linux/amd64 -t hsz1273327/gh-oauth-server:amd64-0.0.2 -t hsz1273327/gh-oauth-server:amd64-latest .
docker buildx build --load --platform=linux/arm/v7 -t hsz1273327/gh-oauth-server:armv7-0.0.2 -t hsz1273327/gh-oauth-server:armv7-latest .
docker push hsz1273327/gh-oauth-server

docker manifest create --amend hsz1273327/gh-oauth-server:0.0.2 hsz1273327/gh-oauth-server:arm64-0.0.2 hsz1273327/gh-oauth-server:amd64-0.0.2 hsz1273327/gh-oauth-server:armv7-0.0.2
docker manifest push --purge hsz1273327/gh-oauth-server:0.0.2

docker manifest create --amend hsz1273327/gh-oauth-server:latest hsz1273327/gh-oauth-server:arm64-latest hsz1273327/gh-oauth-server:amd64-latest hsz1273327/gh-oauth-server:armv7-latest
docker manifest push --purge hsz1273327/gh-oauth-server:latest
10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: "2.4"
services:
gh-oauth-server:
image: hsz1273327/gh-oauth-server:amd64-latest
ports:
- 9527:3000
cpu_percent: 20
mem_limit: 200m
memswap_limit: 300m
restart: on-failure
12 changes: 12 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM --platform=$TARGETPLATFORM node:latest

ADD server.js /app/server.js
ADD package.json /app/package.json
WORKDIR /app
#安装依赖
RUN npm config set registry https://registry.npm.taobao.org
RUN npm install
#对外暴露的端口
EXPOSE 3000
HEALTHCHECK --interval=1m30s --timeout=10s --start-period=10s --retries=3 CMD [ "curl","http://localhost:3000/ping" ]
CMD [ "npm","start"]
Loading

0 comments on commit 09096ca

Please sign in to comment.