Compare commits

..

6 Commits

2 changed files with 21 additions and 21 deletions

View File

@@ -1,23 +1,23 @@
FROM cgr.dev/chainguard/node:20-dev AS deps FROM node:20-bookworm-slim AS deps
WORKDIR /app WORKDIR /app
COPY package.json package-lock.json ./ COPY package.json package-lock.json ./
RUN npm ci RUN npm ci
FROM cgr.dev/chainguard/node:20-dev AS builder FROM node:20-bookworm-slim AS builder
WORKDIR /app WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules COPY --from=deps /app/node_modules ./node_modules
COPY . . COPY . .
RUN npm run build RUN npm run build
FROM cgr.dev/chainguard/node:20-dev AS prod-deps FROM node:20-bookworm-slim AS prod-deps
WORKDIR /app WORKDIR /app
COPY package.json package-lock.json ./ COPY package.json package-lock.json ./
RUN npm ci --omit=dev RUN npm ci --omit=dev
FROM cgr.dev/chainguard/node:20 AS runner FROM cr.io/distroless/nodejs20-debian13 AS runner
WORKDIR /app WORKDIR /app
ENV NODE_ENV=production ENV NODE_ENV=production

34
Jenkinsfile vendored
View File

@@ -1,7 +1,7 @@
pipeline { pipeline {
// Build + deploy stages require Docker CLI/daemon access on the Jenkins node. // Build + deploy stages require Docker CLI/daemon access on the Jenkins node.
// Ensure this label maps to an agent with Docker installed and usable. // Ensure this label maps to an agent with Docker installed and usable.
agent { label 'docker' } agent any
environment { environment {
REGISTRY_IMAGE = "plesk-agency-portal" REGISTRY_IMAGE = "plesk-agency-portal"
@@ -10,24 +10,24 @@ pipeline {
} }
stages { stages {
stage('Preflight') { // stage('Preflight') {
steps { // steps {
sh ''' // sh '''
set -euo pipefail // set -euo pipefail
if ! command -v docker >/dev/null 2>&1; then // if ! command -v docker >/dev/null 2>&1; then
echo "Docker CLI is not available on this Jenkins agent." // echo "Docker CLI is not available on this Jenkins agent."
echo "Run this pipeline on a Docker-capable node (label: docker) or install Docker on the current agent." // echo "Run this pipeline on a Docker-capable node or install Docker on the current agent."
exit 1 // exit 1
fi // fi
if ! docker version >/dev/null 2>&1; then // if ! docker version >/dev/null 2>&1; then
echo "Docker is installed but not usable by Jenkins (daemon/socket/permissions issue)." // echo "Docker is installed but not usable by Jenkins (daemon/socket/permissions issue)."
exit 1 // exit 1
fi // fi
''' // '''
} // }
} // }
stage('Checkout') { stage('Checkout') {
steps { steps {