update node kernels

This commit is contained in:
Zheyuan Wu
2025-11-05 01:22:40 -06:00
parent a9d84cb2bb
commit 1d662e1f32
5 changed files with 40 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
# Source: https://github.com/vercel/next.js/blob/canary/examples/with-docker-multi-env/docker/production/Dockerfile # Source: https://github.com/vercel/next.js/blob/canary/examples/with-docker-multi-env/docker/production/Dockerfile
# syntax=docker.io/docker/dockerfile:1 # syntax=docker.io/docker/dockerfile:1
FROM node:18-alpine AS base FROM node:20-alpine AS base
ENV NODE_OPTIONS="--max-old-space-size=8192" ENV NODE_OPTIONS="--max-old-space-size=8192"

39
docker/Jenkinsfile vendored
View File

@@ -60,13 +60,44 @@ pipeline {
} }
} }
} }
stage('Cleanup Docker tags') {
steps {
script {
echo "1. Stopping existing container"
sh 'docker compose -f ./docker/docker-compose.yaml down'
// Using Workspace Cleanup Plugin (if installed and configured)
echo "2. Removing existing images"
def imageNameMath = "${registry}-math:latest"
def imageNameCSE = "${registry}-cse:latest"
def oldImageIDMath = sh(
script: 'docker images -qf reference=\${imageNameMath}',
returnStdout: true
)
def oldImageIDCSE = sh(
script: 'docker images -qf reference=\${imageNameCSE}',
returnStdout: true
)
echo "Image Name: " + "${imageName}"
echo "Old Image: ${oldImageID}"
if ( "${oldImageIDMath}" != '' ) {
sh 'docker rmi ${oldImageIDMath}'
}else{
echo "Warning: ${imageNameMath} does not exist"
}
if ( "${oldImageIDCSE}" != '' ) {
sh 'docker rmi ${oldImageIDCSE}'
}else{
echo "Warning: ${imageNameCSE} does not exist"
}
echo "3. Assigned new tags to the images"
sh 'docker tag ${registry}-math:v${version}.${env.BUILD_ID} ${registry}-math:latest'
sh 'docker tag ${registry}-cse:v${version}.${env.BUILD_ID} ${registry}-cse:latest'
}
}
}
stage('Deploy') { stage('Deploy') {
steps { steps {
script { script {
echo "Stopping existing container"
sh 'docker compose -f ./docker/docker-compose.yaml down'
echo "Removing existing container"
sh 'docker compose -f ./docker/docker-compose.yaml rm -f'
echo "Deploying docker image ${registry}-math:${version}.${env.BUILD_ID} and ${registry}-cse:${version}.${env.BUILD_ID} with docker compose" echo "Deploying docker image ${registry}-math:${version}.${env.BUILD_ID} and ${registry}-cse:${version}.${env.BUILD_ID} with docker compose"
sh 'docker compose -f ./docker/docker-compose.yaml up -d' sh 'docker compose -f ./docker/docker-compose.yaml up -d'
} }

View File

@@ -3,7 +3,7 @@
# Source: https://github.com/vercel/next.js/blob/canary/examples/with-docker-multi-env/docker/production/Dockerfile # Source: https://github.com/vercel/next.js/blob/canary/examples/with-docker-multi-env/docker/production/Dockerfile
# syntax=docker.io/docker/dockerfile:1 # syntax=docker.io/docker/dockerfile:1
FROM node:18-alpine AS base FROM node:20-alpine AS base
ENV NODE_OPTIONS="--max-old-space-size=8192" ENV NODE_OPTIONS="--max-old-space-size=8192"

View File

@@ -4,6 +4,7 @@ services:
# you may need to update relative directories if you move this file # you may need to update relative directories if you move this file
# default created directories is /docker/docker-compose.yaml # default created directories is /docker/docker-compose.yaml
notenextra-math: notenextra-math:
image: trance0/notenextra-math:latest
build: build:
context: ../ context: ../
dockerfile: ./docker/math/Dockerfile dockerfile: ./docker/math/Dockerfile
@@ -13,6 +14,7 @@ services:
ports: ports:
- 13001:4200 - 13001:4200
notenextra-cse: notenextra-cse:
image: trance0/notenextra-cse:latest
build: build:
context: ../ context: ../
dockerfile: ./docker/cse/Dockerfile dockerfile: ./docker/cse/Dockerfile

View File

@@ -3,7 +3,7 @@
# Source: https://github.com/vercel/next.js/blob/canary/examples/with-docker-multi-env/docker/production/Dockerfile # Source: https://github.com/vercel/next.js/blob/canary/examples/with-docker-multi-env/docker/production/Dockerfile
# syntax=docker.io/docker/dockerfile:1 # syntax=docker.io/docker/dockerfile:1
FROM node:18-alpine AS base FROM node:20-alpine AS base
ENV NODE_OPTIONS="--max-old-space-size=8192" ENV NODE_OPTIONS="--max-old-space-size=8192"