🗻 Switched to node 21 alpine

This commit is contained in:
2025-02-25 13:45:35 -05:00
parent 030f89b258
commit 77d21d3046

View File

@@ -1,4 +1,4 @@
FROM node:22.1.0-bullseye FROM node:21-alpine3.18
# Set metadata for contact # Set metadata for contact
LABEL maintainer="Rishi Ghan <rishi.ghan@gmail.com>" LABEL maintainer="Rishi Ghan <rishi.ghan@gmail.com>"
@@ -10,32 +10,40 @@ ENV NODE_ENV=production
# Set the working directory # Set the working directory
WORKDIR /core-services WORKDIR /core-services
# Install required packages # Install required dependencies using apk
RUN apt-get update && apt-get install -y \ RUN apk update && apk add --no-cache \
libvips-tools \ bash \
wget \ wget \
imagemagick \ imagemagick \
python3 \ python3 \
xvfb \ xvfb \
xz-utils \ build-base \
curl \ g++ \
bash \ python3-dev \
software-properties-common \ p7zip \
build-essential \ curl \
g++ \ git \
python3-dev glib \
cairo-dev \
pango-dev \
icu-dev \
pkgconfig
# Install p7zip # Install libvips from source
RUN apt-get update && apt-get install -y p7zip RUN wget https://github.com/libvips/libvips/releases/download/v8.13.0/vips-8.13.0.tar.gz \
&& tar -zxvf vips-8.13.0.tar.gz \
&& cd vips-8.13.0 \
&& ./configure --disable-python \
&& make -j$(nproc) \
&& make install \
&& cd .. \
&& rm -rf vips-8.13.0.tar.gz vips-8.13.0
# Install unrar directly from RARLAB # Install unrar directly from RARLAB
RUN wget https://www.rarlab.com/rar/rarlinux-x64-621.tar.gz \ RUN wget https://www.rarlab.com/rar/rarlinux-x64-621.tar.gz \
&& tar -zxvf rarlinux-x64-621.tar.gz \ && tar -zxvf rarlinux-x64-621.tar.gz \
&& cp rar/unrar /usr/bin/ \ && cp rar/unrar /usr/bin/ \
&& rm -rf rarlinux-x64-621.tar.gz rar && rm -rf rarlinux-x64-621.tar.gz rar
# Clean up package lists
RUN rm -rf /var/lib/apt/lists/*
# Verify Node.js installation # Verify Node.js installation
RUN node -v && npm -v RUN node -v && npm -v
@@ -50,7 +58,7 @@ RUN npm install
# Clear npm cache and install sharp with build-from-source # Clear npm cache and install sharp with build-from-source
RUN npm cache clean --force RUN npm cache clean --force
RUN npm install --force --arch=arm64 --platform=linux sharp --build-from-source RUN npm install --force @img/sharp-linuxmusl-arm64
# Install global dependencies # Install global dependencies
RUN npm install -g typescript ts-node RUN npm install -g typescript ts-node
@@ -60,7 +68,7 @@ COPY . .
# Build and clean up # Build and clean up
RUN npm run build \ RUN npm run build \
&& npm prune && npm prune
# Expose the application's port # Expose the application's port
EXPOSE 3000 EXPOSE 3000