Deployment Issues w/ Java: What’s the right config?
Overview
We recently had a cascade of issues preventing us from building & deploying a production webapp due to node dependency and Java issues (which aspose.cells depends on). Thankfully we were able to resolve it with a bunch of debugging, version pinning, downgrading, switching container images, and npm incantations. However, I am curious what Aspose’s recommended setup is for aspose.cells – because it seems the documentation is out of date or incorrect.
We believe one of the causes was an update in a pinned Java npm package.
Below are high-level details of our current setup.
Stack
Architecture & Framework
- Monorepo Structure: NX-based monorepo with multiple applications and libraries
- Primary Language: TypeScript/JavaScript (Node.js)
- Frontend: React 18.2.0 with Redux Toolkit for state management
- Backend: Express.js-based microservices architecture
Java Runtime Environment
Base Image: OpenJDK 8 in Docker containers
Java Environment Variables:
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
JAVA_TOOL_OPTIONS="-Xms2g -Xmx6g"
Aspose.Cells
Package : aspose.cells@24.6.0
Java Bridge : java@0.16.1
Node Dependencies
{
"java": "^0.16.1",
"aspose.cells": "^x.x.x", // 24.6.0 installed manually in Docker
"python2.7": "system"
}
CI/CD
Via GitLab runners.
Container Images:
- Web:
node:16-alpine
- APIs:
openjdk:8
with Node.js 16
What Fixed Docker Builds
npm install --legacy-peer-deps && npm config set unsafe-perm true
- Setting
$JAVE_HOME
explicitly and adding it to$PATH
- Downgrading our container images to
node:16-alpine
fromnode:20-alpine
- Overriding
brace-expansion
(^1.1.11
) andminimatch
(^9.0.0
) in package.json - Removing installing
node-java
from npm and defaulting to the container image’s Java
Curious to know if what we have is the correct approach.