Some checks failed
Node.js CI - Dockge / ${{ matrix.os }} (22, ubuntu-latest) (push) Successful in 1m47s
json-yaml-validate / json-yaml-validate (push) Successful in 12s
Nightly Release / release-nightly (push) Failing after 44s
Node.js CI - Dockge / ${{ matrix.os }} (22, macos-latest) (push) Has been cancelled
Node.js CI - Dockge / ${{ matrix.os }} (22, windows-latest) (push) Has been cancelled
61 lines
2.3 KiB
Docker
61 lines
2.3 KiB
Docker
############################################
|
|
# Healthcheck Binary
|
|
############################################
|
|
FROM louislam/dockge:build-healthcheck AS build_healthcheck
|
|
|
|
############################################
|
|
# Build
|
|
############################################
|
|
FROM louislam/dockge:base AS build
|
|
WORKDIR /app
|
|
COPY --chown=node:node ./package.json ./package.json
|
|
COPY --chown=node:node ./package-lock.json ./package-lock.json
|
|
RUN npm ci --omit=dev
|
|
|
|
############################################
|
|
# ⭐ Main Image
|
|
############################################
|
|
FROM louislam/dockge:base AS release
|
|
ARG TARGETARCH
|
|
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 . .
|
|
RUN mkdir ./data
|
|
|
|
# Grype is available upstream for the amd64 and arm64 images.
|
|
RUN set -eu; \
|
|
case "$TARGETARCH" in \
|
|
amd64) checksum=e9da18cc1429e786722e32161288103600efffd8e483c90761f90485bd1bec85 ;; \
|
|
arm64) checksum=b7815598d48da78bfd16f5b98ef28e1bb09c03d34fc8c3e350f99b6ccb3c7cba ;; \
|
|
*) echo "Install Grype separately to enable image scans on $TARGETARCH"; exit 0 ;; \
|
|
esac; \
|
|
temp_dir="$(mktemp -d)"; \
|
|
trap 'rm -rf "$temp_dir"' EXIT; \
|
|
curl --fail --location --retry 3 \
|
|
"https://github.com/anchore/grype/releases/download/v0.121.3/grype_0.121.3_linux_${TARGETARCH}.tar.gz" \
|
|
--output "$temp_dir/grype.tar.gz"; \
|
|
echo "$checksum $temp_dir/grype.tar.gz" | sha256sum --check --status; \
|
|
tar -xzf "$temp_dir/grype.tar.gz" -C "$temp_dir" grype LICENSE; \
|
|
install -m 0755 "$temp_dir/grype" /usr/local/bin/grype; \
|
|
install -D -m 0644 "$temp_dir/LICENSE" /usr/share/doc/grype/LICENSE
|
|
|
|
|
|
# It is just for safe, as by default, it is disabled in the latest Node.js now.
|
|
# Read more:
|
|
# - https://github.com/sagemathinc/cocalc/issues/6963
|
|
# - https://github.com/microsoft/node-pty/issues/630#issuecomment-1987212447
|
|
ENV UV_USE_IO_URING=0
|
|
|
|
VOLUME /app/data
|
|
EXPOSE 5001
|
|
HEALTHCHECK --interval=60s --timeout=30s --start-period=60s --retries=5 CMD extra/healthcheck
|
|
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
|
|
CMD ["tsx", "./backend/index.ts"]
|
|
|
|
############################################
|
|
# Mark as Nightly
|
|
############################################
|
|
FROM release AS nightly
|
|
RUN npm run mark-as-nightly
|