2023-11-30 08:10:37 +00:00
|
|
|
############################################
|
|
|
|
# Healthcheck Binary
|
|
|
|
############################################
|
|
|
|
FROM louislam/dockge:build-healthcheck AS build_healthcheck
|
|
|
|
|
2023-11-11 14:18:37 +00:00
|
|
|
############################################
|
|
|
|
# Build
|
|
|
|
############################################
|
|
|
|
FROM louislam/dockge:base AS build
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --chown=node:node ./package.json ./package.json
|
|
|
|
COPY --chown=node:node ./pnpm-lock.yaml ./pnpm-lock.yaml
|
|
|
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
|
|
|
|
|
|
|
|
############################################
|
|
|
|
# ⭐ Main Image
|
|
|
|
############################################
|
|
|
|
FROM louislam/dockge:base AS release
|
|
|
|
WORKDIR /app
|
2023-11-30 08:10:37 +00:00
|
|
|
COPY --chown=node:node --from=build_healthcheck /app/extra/healthcheck /app/extra/healthcheck
|
2023-11-11 14:18:37 +00:00
|
|
|
COPY --from=build /app/node_modules /app/node_modules
|
2023-11-30 08:10:37 +00:00
|
|
|
COPY --chown=node:node . .
|
2023-11-11 14:18:37 +00:00
|
|
|
RUN mkdir ./data
|
|
|
|
|
2024-10-13 12:36:04 +00:00
|
|
|
|
|
|
|
# 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
|
|
|
|
|
2023-11-11 14:18:37 +00:00
|
|
|
VOLUME /app/data
|
|
|
|
EXPOSE 5001
|
2023-11-30 08:10:37 +00:00
|
|
|
HEALTHCHECK --interval=60s --timeout=30s --start-period=60s --retries=5 CMD extra/healthcheck
|
2023-11-11 14:18:37 +00:00
|
|
|
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
|
2024-01-18 18:13:43 +00:00
|
|
|
CMD ["bash", "-c", "node ./extra/clean-tsx-tmp.js && tsx ./backend/index.ts"]
|
2023-11-11 14:18:37 +00:00
|
|
|
|
|
|
|
############################################
|
|
|
|
# Mark as Nightly
|
|
|
|
############################################
|
|
|
|
FROM release AS nightly
|
|
|
|
RUN pnpm run mark-as-nightly
|