mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-12-02 17:13:33 +01:00
fix: restore Node deployment and keep Go on its branch
This commit is contained in:
1 parent
1983441c68
commit
bff2e343fd
602 files changed
+92
-1026486
No files matched your search
@@ -1,39 +0,0 @@
|
||||
# syntax=docker/dockerfile:1.7
|
||||
|
||||
# Stage 1: install all deps (with cache mount so npm cache survives across builds)
|
||||
FROM node:22-slim AS deps
|
||||
WORKDIR /app
|
||||
COPY package.json package-lock.json ./
|
||||
RUN --mount=type=cache,id=npm-all,target=/root/.npm,sharing=locked \
|
||||
npm ci --prefer-offline --no-audit --fund=false
|
||||
|
||||
# Stage 2: build TypeScript + gulp assets. Source changes only invalidate from here.
|
||||
FROM node:22-slim AS build
|
||||
WORKDIR /app
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY package.json package-lock.json tsconfig.json gulpfile.js ./
|
||||
COPY public ./public
|
||||
COPY src ./src
|
||||
RUN npm run build
|
||||
|
||||
# Stage 3: prod-only deps. Independent of source so it caches well.
|
||||
FROM node:22-slim AS prod-deps
|
||||
WORKDIR /app
|
||||
COPY package.json package-lock.json ./
|
||||
RUN --mount=type=cache,id=npm-prod,target=/root/.npm,sharing=locked \
|
||||
npm ci --omit=dev --prefer-offline --no-audit --fund=false
|
||||
|
||||
# Keep the runtime libc consistent with native dependencies installed above.
|
||||
FROM node:22-slim AS runtime
|
||||
ENV NODE_ENV=production
|
||||
ENV PORT=5000
|
||||
EXPOSE 5000
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=prod-deps /app/node_modules ./node_modules
|
||||
COPY --from=build /app/build ./build
|
||||
COPY --from=build /app/public ./public
|
||||
COPY package.json ./package.json
|
||||
COPY healthcheck.js ./healthcheck.js
|
||||
|
||||
CMD ["node", "--max-old-space-size=2048", "./build/server/index.js"]
|
||||
Reference in new issue
Block a user