mirror of
https://github.com/louislam/dockge.git
synced 2026-05-23 15:02:16 +00:00
Compare commits
2 Commits
healthchec
...
arm-runner
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ad00e8badf | ||
|
|
771bcd5b3e |
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@@ -14,8 +14,8 @@ jobs:
|
|||||||
ci:
|
ci:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
os: [ubuntu-latest, windows-latest, macos-latest, ARM64]
|
||||||
node: [20.x] # Can be changed
|
node: [18.17.1] # Can be changed
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
############################################
|
|
||||||
# Build in Golang
|
|
||||||
############################################
|
|
||||||
FROM golang:1.21.4-bookworm
|
|
||||||
WORKDIR /app
|
|
||||||
ARG TARGETPLATFORM
|
|
||||||
COPY ./extra/healthcheck.go ./extra/healthcheck.go
|
|
||||||
|
|
||||||
# Compile healthcheck.go
|
|
||||||
RUN go build -x -o ./extra/healthcheck ./extra/healthcheck.go
|
|
||||||
@@ -1,8 +1,3 @@
|
|||||||
############################################
|
|
||||||
# Healthcheck Binary
|
|
||||||
############################################
|
|
||||||
FROM louislam/dockge:build-healthcheck AS build_healthcheck
|
|
||||||
|
|
||||||
############################################
|
############################################
|
||||||
# Build
|
# Build
|
||||||
############################################
|
############################################
|
||||||
@@ -17,17 +12,16 @@ RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-l
|
|||||||
############################################
|
############################################
|
||||||
FROM louislam/dockge:base AS release
|
FROM louislam/dockge:base AS release
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --chown=node:node --from=build_healthcheck /app/extra/healthcheck /app/extra/healthcheck
|
|
||||||
COPY --from=build /app/node_modules /app/node_modules
|
|
||||||
COPY --chown=node:node . .
|
COPY --chown=node:node . .
|
||||||
|
COPY --from=build /app/node_modules /app/node_modules
|
||||||
RUN mkdir ./data
|
RUN mkdir ./data
|
||||||
|
|
||||||
VOLUME /app/data
|
VOLUME /app/data
|
||||||
EXPOSE 5001
|
EXPOSE 5001
|
||||||
HEALTHCHECK --interval=60s --timeout=30s --start-period=60s --retries=5 CMD extra/healthcheck
|
|
||||||
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
|
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
|
||||||
CMD ["tsx", "./backend/index.ts"]
|
CMD ["tsx", "./backend/index.ts"]
|
||||||
|
|
||||||
|
|
||||||
############################################
|
############################################
|
||||||
# Mark as Nightly
|
# Mark as Nightly
|
||||||
############################################
|
############################################
|
||||||
|
|||||||
@@ -1,74 +0,0 @@
|
|||||||
/*
|
|
||||||
* If changed, have to run `npm run build-docker-builder-go`.
|
|
||||||
* This script should be run after a period of time (180s), because the server may need some time to prepare.
|
|
||||||
*/
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"crypto/tls"
|
|
||||||
"io/ioutil"
|
|
||||||
"log"
|
|
||||||
"net/http"
|
|
||||||
"os"
|
|
||||||
"strings"
|
|
||||||
"time"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
// Is K8S + "dockge" as the container name
|
|
||||||
// See https://github.com/louislam/uptime-kuma/pull/2083
|
|
||||||
isK8s := strings.HasPrefix(os.Getenv("DOCKGE_PORT"), "tcp://")
|
|
||||||
|
|
||||||
// process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
|
|
||||||
http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{
|
|
||||||
InsecureSkipVerify: true,
|
|
||||||
}
|
|
||||||
|
|
||||||
client := http.Client{
|
|
||||||
Timeout: 28 * time.Second,
|
|
||||||
}
|
|
||||||
|
|
||||||
sslKey := os.Getenv("DOCKGE_SSL_KEY")
|
|
||||||
sslCert := os.Getenv("DOCKGE_SSL_CERT")
|
|
||||||
|
|
||||||
hostname := os.Getenv("DOCKGE_HOST")
|
|
||||||
if len(hostname) == 0 {
|
|
||||||
hostname = "127.0.0.1"
|
|
||||||
}
|
|
||||||
|
|
||||||
port := ""
|
|
||||||
// DOCKGE_PORT is override by K8S unexpectedly,
|
|
||||||
if !isK8s {
|
|
||||||
port = os.Getenv("DOCKGE_PORT")
|
|
||||||
}
|
|
||||||
if len(port) == 0 {
|
|
||||||
port = "5001"
|
|
||||||
}
|
|
||||||
|
|
||||||
protocol := ""
|
|
||||||
if len(sslKey) != 0 && len(sslCert) != 0 {
|
|
||||||
protocol = "https"
|
|
||||||
} else {
|
|
||||||
protocol = "http"
|
|
||||||
}
|
|
||||||
|
|
||||||
url := protocol + "://" + hostname + ":" + port
|
|
||||||
|
|
||||||
log.Println("Checking " + url)
|
|
||||||
resp, err := client.Get(url)
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
log.Fatalln(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
defer resp.Body.Close()
|
|
||||||
|
|
||||||
_, err = ioutil.ReadAll(resp.Body)
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
log.Fatalln(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
log.Printf("Health Check OK [Res Code: %d]\n", resp.StatusCode)
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -17,7 +17,6 @@
|
|||||||
"build:docker-base": "docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/dockge:base -f ./docker/Base.Dockerfile . --push",
|
"build:docker-base": "docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/dockge:base -f ./docker/Base.Dockerfile . --push",
|
||||||
"build:docker": "node ./extra/env2arg.js docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/dockge:latest -t louislam/dockge:1 -t louislam/dockge:$VERSION --target release -f ./docker/Dockerfile . --push",
|
"build:docker": "node ./extra/env2arg.js docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/dockge:latest -t louislam/dockge:1 -t louislam/dockge:$VERSION --target release -f ./docker/Dockerfile . --push",
|
||||||
"build:docker-nightly": "pnpm run build:frontend && docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/dockge:nightly --target nightly -f ./docker/Dockerfile . --push",
|
"build:docker-nightly": "pnpm run build:frontend && docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/dockge:nightly --target nightly -f ./docker/Dockerfile . --push",
|
||||||
"build:healthcheck": "docker buildx build -f docker/BuildHealthCheck.Dockerfile --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/dockge:build-healthcheck . --push",
|
|
||||||
"start-docker": "docker run --rm -p 5001:5001 --name dockge louislam/dockge:latest",
|
"start-docker": "docker run --rm -p 5001:5001 --name dockge louislam/dockge:latest",
|
||||||
"mark-as-nightly": "tsx ./extra/mark-as-nightly.ts",
|
"mark-as-nightly": "tsx ./extra/mark-as-nightly.ts",
|
||||||
"reformat-changelog": "tsx ./extra/reformat-changelog.ts"
|
"reformat-changelog": "tsx ./extra/reformat-changelog.ts"
|
||||||
|
|||||||
Reference in New Issue
Block a user