diff --git a/.github/workflows/release-dockerhub.yml b/.github/workflows/release-dockerhub.yml index de86912..536c3dc 100644 --- a/.github/workflows/release-dockerhub.yml +++ b/.github/workflows/release-dockerhub.yml @@ -113,7 +113,7 @@ jobs: uses: docker/build-push-action@v6 with: context: . - file: ./docker/Dockerfile + file: ./Dockerfile platforms: linux/amd64,linux/arm64 push: true tags: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8b7cbc1..da3264f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -114,7 +114,7 @@ jobs: uses: docker/build-push-action@v6 with: context: . - file: ./docker/Dockerfile + file: ./Dockerfile platforms: linux/amd64,linux/arm64 push: true tags: | diff --git a/Dockerfile b/Dockerfile index c86f82d..6996f43 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,12 +8,15 @@ RUN npm run build FROM golang:1.24 AS go-builder WORKDIR /app -ARG TARGETOS=linux -ARG TARGETARCH=amd64 +ARG TARGETOS +ARG TARGETARCH COPY go.mod go.sum* ./ RUN go mod download COPY . . -RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o /out/ds2api ./cmd/ds2api +RUN set -eux; \ + GOOS="${TARGETOS:-$(go env GOOS)}"; \ + GOARCH="${TARGETARCH:-$(go env GOARCH)}"; \ + CGO_ENABLED=0 GOOS="${GOOS}" GOARCH="${GOARCH}" go build -o /out/ds2api ./cmd/ds2api FROM busybox:1.36.1-musl AS busybox-tools diff --git a/start.mjs b/start.mjs index 59c5101..d168be3 100644 --- a/start.mjs +++ b/start.mjs @@ -338,7 +338,8 @@ function showStatus() { function waitForProcesses() { return new Promise(resolve => { const check = setInterval(() => { - if (processes.filter(p => !p.killed).length === 0) { + const activeCount = processes.filter(proc => proc.exitCode === null && proc.signalCode === null).length; + if (activeCount === 0) { clearInterval(check); resolve(); }