ci: remove SKIP_SIGNER_BUILD usage; build signer unconditionally and simplify script

This commit is contained in:
Debian 2025-09-04 21:11:02 +00:00
parent d828e24584
commit 29a07760a1
2 changed files with 11 additions and 28 deletions

View File

@ -1,35 +1,17 @@
FROM node:20-alpine AS base
# Install production dependencies only by default
ENV NODE_ENV=production
WORKDIR /app
# Install build dependencies
FROM base AS deps
ENV NODE_ENV=development
RUN apk add --no-cache python3 make g++
COPY package.json package-lock.json* ./
FROM node:18-slim AS builder
WORKDIR /usr/src/app
COPY package.json package-lock.json ./
RUN npm ci
# Build TypeScript
FROM deps AS build
COPY tsconfig.json ./
COPY src ./src
COPY pkg ./pkg
RUN npm run build
# Runtime image
FROM base AS runner
WORKDIR /app
ENV NODE_ENV=production
RUN addgroup -S nodejs && adduser -S nodejs -G nodejs
COPY --from=deps /app/node_modules ./node_modules
COPY --from=build /app/dist ./dist
COPY --from=build /app/pkg ./pkg
FROM node:18-slim
WORKDIR /usr/src/app
COPY --from=builder /usr/src/app/dist ./dist
COPY --from=builder /usr/src/app/package.json ./package.json
COPY --from=builder /usr/src/app/node_modules ./node_modules
EXPOSE 9090
USER nodejs
CMD ["node", "dist/index.js"]
ENV PORT=9090
CMD ["node","dist/index.js"]

View File

@ -9,6 +9,7 @@ while IFS= read -r df; do
rel=${dir#"$BASE_DIR/"}
img_tag="4nk-node-"$(echo "$rel" | tr '/' '-')":latest"
echo "Building $img_tag from $dir"
# signer image will always be built
docker build -t "$img_tag" "$dir"
done < <(find "$BASE_DIR" -name Dockerfile -print)