Skip to content

Commit

Permalink
Update node, docker packages and apt installation configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
stankolubomir committed Sep 2, 2024
1 parent 99a0bdf commit a8d921c
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 65 deletions.
16 changes: 7 additions & 9 deletions build/node20/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# PLEASE DO NOT EDIT IT DIRECTLY!
# CHECK README FOR MORE INFO.
#
FROM node:20.12.2
FROM node:20.17.0

LABEL maintainer="Lubomir Stanko <[email protected]>"

Expand All @@ -16,6 +16,7 @@ ENV CONFIG_OWNER_NAME=node \
CONFIG_GROUP_NAME=node \
CONTAINER_STOP_LOG_FILE="/var/www/html/var/log/container_stop.log" \
COREPACK_HOME="/usr/lib/node/corepack" \
COREPACK_ENABLE_DOWNLOAD_PROMPT=0 \
MAIN_TERMINATED_FILE="/var/www/html/var/log/main-terminated" \
NPM_CONFIG_LOGLEVEL=notice \
YARN_CACHE_FOLDER="/var/cache/yarn" \
Expand Down Expand Up @@ -43,9 +44,10 @@ ENV RUN_DEPS="ca-certificates \
# PACKAGES
# ----------------------------------------------------------------------------------------------------------------------
RUN apt-get update && \
APT_SUPERVISOR_VERSION=$(apt-cache madison supervisor | awk -v ver="4.2.5" '$3 ~ ver {print $3; exit}') && \
apt-get install -y \
${RUN_DEPS} \
supervisor=4.2.5-1 && \
supervisor=${APT_SUPERVISOR_VERSION} && \
# Cleanup
apt-get clean && \
rm -rf /var/lib/apt/lists/*
Expand All @@ -54,18 +56,14 @@ RUN apt-get update && \
# NPM
# Install static npm version
# ----------------------------------------------------------------------------------------------------------------------
RUN npm install --location=global npm@10.5.2 && \
npm install --location=global auditjs@4.0.45 && \
RUN npm install --location=global npm@latest && \
npm install --location=global auditjs@latest && \
mkdir -p ${COREPACK_HOME} && \
corepack prepare yarn@4.1.1 --activate && \
corepack prepare yarn@stable --activate && \
corepack enable && \
# Node cache cleanup
npm cache clean --force && \
yarn cache clean --all
# Versions of local tools
RUN echo "node version: $(node -v) \n" \
"npm version: $(npm -v) \n" \
"yarn version: $(yarn -v)"

# ----------------------------------------------------------------------------------------------------------------------
# USER SETUP
Expand Down
36 changes: 20 additions & 16 deletions build/node20/nginx-browsers/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# PLEASE DO NOT EDIT IT DIRECTLY!
# CHECK README FOR MORE INFO.
#
FROM node:20.12.2
FROM node:20.17.0

LABEL maintainer="Lubomir Stanko <[email protected]>"

Expand All @@ -16,6 +16,7 @@ ENV CONFIG_OWNER_NAME=node \
CONFIG_GROUP_NAME=node \
CONTAINER_STOP_LOG_FILE="/var/www/html/var/log/container_stop.log" \
COREPACK_HOME="/usr/lib/node/corepack" \
COREPACK_ENABLE_DOWNLOAD_PROMPT=0 \
MAIN_TERMINATED_FILE="/var/www/html/var/log/main-terminated" \
NPM_CONFIG_LOGLEVEL=notice \
YARN_CACHE_FOLDER="/var/cache/yarn" \
Expand Down Expand Up @@ -43,9 +44,10 @@ ENV RUN_DEPS="ca-certificates \
# PACKAGES
# ----------------------------------------------------------------------------------------------------------------------
RUN apt-get update && \
APT_SUPERVISOR_VERSION=$(apt-cache madison supervisor | awk -v ver="4.2.5" '$3 ~ ver {print $3; exit}') && \
apt-get install -y \
${RUN_DEPS} \
supervisor=4.2.5-1 && \
supervisor=${APT_SUPERVISOR_VERSION} && \
# Cleanup
apt-get clean && \
rm -rf /var/lib/apt/lists/*
Expand All @@ -54,18 +56,14 @@ RUN apt-get update && \
# NPM
# Install static npm version
# ----------------------------------------------------------------------------------------------------------------------
RUN npm install --location=global npm@10.5.2 && \
npm install --location=global auditjs@4.0.45 && \
RUN npm install --location=global npm@latest && \
npm install --location=global auditjs@latest && \
mkdir -p ${COREPACK_HOME} && \
corepack prepare yarn@4.1.1 --activate && \
corepack prepare yarn@stable --activate && \
corepack enable && \
# Node cache cleanup
npm cache clean --force && \
yarn cache clean --all
# Versions of local tools
RUN echo "node version: $(node -v) \n" \
"npm version: $(npm -v) \n" \
"yarn version: $(yarn -v)"

# ----------------------------------------------------------------------------------------------------------------------
# USER SETUP
Expand Down Expand Up @@ -121,6 +119,7 @@ ENV NGINX_ACCESS_LOG="/var/log/nginx/access.log main" \
NGINX_WORKER_RLIMIT_NOFILE=65535 \
NGINX_X_CONTENT_TYPE_OPTIONS="nosniff" \
NGINX_X_XSS_PROTECTION="1; mode=block"

# ----------------------------------------------------------------------------------------------------------------------
# NGINX
RUN DEBIAN_FRONTEND=noninteractive && \
Expand All @@ -129,12 +128,17 @@ RUN DEBIAN_FRONTEND=noninteractive && \
curl -fsSL https://nginx.org/keys/nginx_signing.key | gpg --dearmor -o ${NGINX_KEYRING} && \
echo "deb [signed-by=${NGINX_KEYRING}] http://nginx.org/packages/debian ${NGINX_REPO}" > /etc/apt/sources.list.d/nginx.list && \
apt-get update && \
APT_NGINX_VERSION=$(apt-cache madison nginx | awk -v ver="1.26.2" '$3 ~ ver {print $3; exit}') && \
APT_NGINX_MODULE_GEOIP_VERSION=$(apt-cache madison nginx-module-geoip | awk -v ver="1.26.2" '$3 ~ ver {print $3; exit}') && \
APT_NGINX_MODULE_IMAGE_FILTER_VERSION=$(apt-cache madison nginx-module-image-filter | awk -v ver="1.26.2" '$3 ~ ver {print $3; exit}') && \
APT_NGINX_MODULE_NJS_VERSION=$(apt-cache madison nginx-module-njs | awk -v ver="1.26.2" '$3 ~ ver {print $3; exit}') && \
APT_NGINX_MODULE_XSLT_VERSION=$(apt-cache madison nginx-module-xslt | awk -v ver="1.26.2" '$3 ~ ver {print $3; exit}') && \
apt-get install --no-install-recommends --no-install-suggests -y \
nginx=1.24.0-1~bookworm \
nginx-module-xslt=1.24.0-1~bookworm \
nginx-module-geoip=1.24.0-1~bookworm \
nginx-module-image-filter=1.24.0-1~bookworm \
nginx-module-njs=1.24.0+0.8.3-1~bookworm && \
nginx=${APT_NGINX_VERSION} \
nginx-module-geoip=${APT_NGINX_MODULE_GEOIP_VERSION} \
nginx-module-image-filter=${APT_NGINX_MODULE_IMAGE_FILTER_VERSION} \
nginx-module-njs=${APT_NGINX_MODULE_NJS_VERSION} \
nginx-module-xslt=${APT_NGINX_MODULE_XSLT_VERSION} && \
# Cleanup
apt-get clean && \
rm -rf /var/lib/apt/lists/*
Expand Down Expand Up @@ -183,7 +187,7 @@ RUN apt-get update && \
apt-get clean && \
rm -r /var/lib/apt/lists/*
# Install Google Chrome
RUN wget -q -O /usr/src/google-chrome-stable_current_amd64.deb "https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_124.0.6367.60-1_amd64.deb" && \
RUN wget -q -O /usr/src/google-chrome-stable_current_amd64.deb "https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_128.0.6613.113-1_amd64.deb" && \
apt-get update && \
dpkg -i /usr/src/google-chrome-stable_current_amd64.deb ; \
apt-get install -f -y && \
Expand All @@ -192,7 +196,7 @@ RUN wget -q -O /usr/src/google-chrome-stable_current_amd64.deb "https://dl.googl
apt-get clean && \
rm -r /var/lib/apt/lists/*
# Install Firefox
RUN wget -q -O /tmp/firefox.tar.bz2 "https://download-installer.cdn.mozilla.net/pub/firefox/releases/125.0.1/linux-x86_64/en-US/firefox-125.0.1.tar.bz2" && \
RUN wget -q -O /tmp/firefox.tar.bz2 "https://download-installer.cdn.mozilla.net/pub/firefox/releases/129.0.2/linux-x86_64/en-US/firefox-129.0.2.tar.bz2" && \
tar -C /opt -xjf /tmp/firefox.tar.bz2 && \
rm -f /tmp/firefox.tar.bz2 && \
ln -fs /opt/firefox/firefox /usr/bin/firefox
Expand Down
32 changes: 18 additions & 14 deletions build/node20/nginx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# PLEASE DO NOT EDIT IT DIRECTLY!
# CHECK README FOR MORE INFO.
#
FROM node:20.12.2
FROM node:20.17.0

LABEL maintainer="Lubomir Stanko <[email protected]>"

Expand All @@ -16,6 +16,7 @@ ENV CONFIG_OWNER_NAME=node \
CONFIG_GROUP_NAME=node \
CONTAINER_STOP_LOG_FILE="/var/www/html/var/log/container_stop.log" \
COREPACK_HOME="/usr/lib/node/corepack" \
COREPACK_ENABLE_DOWNLOAD_PROMPT=0 \
MAIN_TERMINATED_FILE="/var/www/html/var/log/main-terminated" \
NPM_CONFIG_LOGLEVEL=notice \
YARN_CACHE_FOLDER="/var/cache/yarn" \
Expand Down Expand Up @@ -43,9 +44,10 @@ ENV RUN_DEPS="ca-certificates \
# PACKAGES
# ----------------------------------------------------------------------------------------------------------------------
RUN apt-get update && \
APT_SUPERVISOR_VERSION=$(apt-cache madison supervisor | awk -v ver="4.2.5" '$3 ~ ver {print $3; exit}') && \
apt-get install -y \
${RUN_DEPS} \
supervisor=4.2.5-1 && \
supervisor=${APT_SUPERVISOR_VERSION} && \
# Cleanup
apt-get clean && \
rm -rf /var/lib/apt/lists/*
Expand All @@ -54,18 +56,14 @@ RUN apt-get update && \
# NPM
# Install static npm version
# ----------------------------------------------------------------------------------------------------------------------
RUN npm install --location=global npm@10.5.2 && \
npm install --location=global auditjs@4.0.45 && \
RUN npm install --location=global npm@latest && \
npm install --location=global auditjs@latest && \
mkdir -p ${COREPACK_HOME} && \
corepack prepare yarn@4.1.1 --activate && \
corepack prepare yarn@stable --activate && \
corepack enable && \
# Node cache cleanup
npm cache clean --force && \
yarn cache clean --all
# Versions of local tools
RUN echo "node version: $(node -v) \n" \
"npm version: $(npm -v) \n" \
"yarn version: $(yarn -v)"

# ----------------------------------------------------------------------------------------------------------------------
# USER SETUP
Expand Down Expand Up @@ -121,6 +119,7 @@ ENV NGINX_ACCESS_LOG="/var/log/nginx/access.log main" \
NGINX_WORKER_RLIMIT_NOFILE=65535 \
NGINX_X_CONTENT_TYPE_OPTIONS="nosniff" \
NGINX_X_XSS_PROTECTION="1; mode=block"

# ----------------------------------------------------------------------------------------------------------------------
# NGINX
RUN DEBIAN_FRONTEND=noninteractive && \
Expand All @@ -129,12 +128,17 @@ RUN DEBIAN_FRONTEND=noninteractive && \
curl -fsSL https://nginx.org/keys/nginx_signing.key | gpg --dearmor -o ${NGINX_KEYRING} && \
echo "deb [signed-by=${NGINX_KEYRING}] http://nginx.org/packages/debian ${NGINX_REPO}" > /etc/apt/sources.list.d/nginx.list && \
apt-get update && \
APT_NGINX_VERSION=$(apt-cache madison nginx | awk -v ver="1.26.2" '$3 ~ ver {print $3; exit}') && \
APT_NGINX_MODULE_GEOIP_VERSION=$(apt-cache madison nginx-module-geoip | awk -v ver="1.26.2" '$3 ~ ver {print $3; exit}') && \
APT_NGINX_MODULE_IMAGE_FILTER_VERSION=$(apt-cache madison nginx-module-image-filter | awk -v ver="1.26.2" '$3 ~ ver {print $3; exit}') && \
APT_NGINX_MODULE_NJS_VERSION=$(apt-cache madison nginx-module-njs | awk -v ver="1.26.2" '$3 ~ ver {print $3; exit}') && \
APT_NGINX_MODULE_XSLT_VERSION=$(apt-cache madison nginx-module-xslt | awk -v ver="1.26.2" '$3 ~ ver {print $3; exit}') && \
apt-get install --no-install-recommends --no-install-suggests -y \
nginx=1.24.0-1~bookworm \
nginx-module-xslt=1.24.0-1~bookworm \
nginx-module-geoip=1.24.0-1~bookworm \
nginx-module-image-filter=1.24.0-1~bookworm \
nginx-module-njs=1.24.0+0.8.3-1~bookworm && \
nginx=${APT_NGINX_VERSION} \
nginx-module-geoip=${APT_NGINX_MODULE_GEOIP_VERSION} \
nginx-module-image-filter=${APT_NGINX_MODULE_IMAGE_FILTER_VERSION} \
nginx-module-njs=${APT_NGINX_MODULE_NJS_VERSION} \
nginx-module-xslt=${APT_NGINX_MODULE_XSLT_VERSION} && \
# Cleanup
apt-get clean && \
rm -rf /var/lib/apt/lists/*
Expand Down
11 changes: 11 additions & 0 deletions doc/Node-Changelog/1.1.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
2024-09-02
===

### Changed
- Updated configuration for apt package installation not having to specify exact apt package build version
- Removed version lock on `auditjs`, `npm` and `yarn` packages - always use latest stable version
- Package updates:
- node `20.17.0`
- nginx `1.26.2`
- google chrome `128.0.6613.113`
- firefox `129.0.2`
14 changes: 6 additions & 8 deletions template.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ ENV CONFIG_OWNER_NAME=node \
CONFIG_GROUP_NAME=node \
CONTAINER_STOP_LOG_FILE="/var/www/html/var/log/container_stop.log" \
COREPACK_HOME="/usr/lib/node/corepack" \
COREPACK_ENABLE_DOWNLOAD_PROMPT=0 \
MAIN_TERMINATED_FILE="/var/www/html/var/log/main-terminated" \
NPM_CONFIG_LOGLEVEL=notice \
YARN_CACHE_FOLDER="/var/cache/yarn" \
Expand Down Expand Up @@ -37,9 +38,10 @@ ENV RUN_DEPS="ca-certificates \
# PACKAGES
# ----------------------------------------------------------------------------------------------------------------------
RUN apt-get update && \
APT_SUPERVISOR_VERSION=$(apt-cache madison supervisor | awk -v ver="${SUPERVISOR_VERSION}" '$3 ~ ver {print $3; exit}') && \
apt-get install -y \
${RUN_DEPS} \
supervisor=${SUPERVISOR_VERSION}-${SUPERVISOR_PKG_RELEASE} && \
supervisor=${APT_SUPERVISOR_VERSION} && \
# Cleanup
apt-get clean && \
rm -rf /var/lib/apt/lists/*
Expand All @@ -48,18 +50,14 @@ RUN apt-get update && \
# NPM
# Install static npm version
# ----------------------------------------------------------------------------------------------------------------------
RUN npm install --location=global npm@${NPM_VERSION} && \
npm install --location=global auditjs@${AUDITJS_VERSION} && \
RUN npm install --location=global npm@latest && \
npm install --location=global auditjs@latest && \
mkdir -p ${COREPACK_HOME} && \
corepack prepare yarn@${YARN_VERSION} --activate && \
corepack prepare yarn@stable --activate && \
corepack enable && \
# Node cache cleanup
npm cache clean --force && \
yarn cache clean --all
# Versions of local tools
RUN echo "node version: $(node -v) \n" \
"npm version: $(npm -v) \n" \
"yarn version: $(yarn -v)"

# ----------------------------------------------------------------------------------------------------------------------
# USER SETUP
Expand Down
16 changes: 11 additions & 5 deletions variant-nginx.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ ENV NGINX_ACCESS_LOG="/var/log/nginx/access.log main" \
NGINX_WORKER_RLIMIT_NOFILE=65535 \
NGINX_X_CONTENT_TYPE_OPTIONS="nosniff" \
NGINX_X_XSS_PROTECTION="1; mode=block"

# ----------------------------------------------------------------------------------------------------------------------
# NGINX
RUN DEBIAN_FRONTEND=noninteractive && \
Expand All @@ -40,12 +41,17 @@ RUN DEBIAN_FRONTEND=noninteractive && \
curl -fsSL https://nginx.org/keys/nginx_signing.key | gpg --dearmor -o ${NGINX_KEYRING} && \
echo "deb [signed-by=${NGINX_KEYRING}] http://nginx.org/packages/debian ${NGINX_REPO}" > /etc/apt/sources.list.d/nginx.list && \
apt-get update && \
APT_NGINX_VERSION=$(apt-cache madison nginx | awk -v ver="${NGINX_VERSION}" '$3 ~ ver {print $3; exit}') && \
APT_NGINX_MODULE_GEOIP_VERSION=$(apt-cache madison nginx-module-geoip | awk -v ver="${NGINX_VERSION}" '$3 ~ ver {print $3; exit}') && \
APT_NGINX_MODULE_IMAGE_FILTER_VERSION=$(apt-cache madison nginx-module-image-filter | awk -v ver="${NGINX_VERSION}" '$3 ~ ver {print $3; exit}') && \
APT_NGINX_MODULE_NJS_VERSION=$(apt-cache madison nginx-module-njs | awk -v ver="${NGINX_VERSION}" '$3 ~ ver {print $3; exit}') && \
APT_NGINX_MODULE_XSLT_VERSION=$(apt-cache madison nginx-module-xslt | awk -v ver="${NGINX_VERSION}" '$3 ~ ver {print $3; exit}') && \
apt-get install --no-install-recommends --no-install-suggests -y \
nginx=${NGINX_VERSION}-${NGINX_PKG_RELEASE} \
nginx-module-xslt=${NGINX_VERSION}-${NGINX_PKG_RELEASE} \
nginx-module-geoip=${NGINX_VERSION}-${NGINX_PKG_RELEASE} \
nginx-module-image-filter=${NGINX_VERSION}-${NGINX_PKG_RELEASE} \
nginx-module-njs=${NGINX_VERSION}+${NGINX_NJS_VERSION}-${NGINX_PKG_RELEASE} && \
nginx=${APT_NGINX_VERSION} \
nginx-module-geoip=${APT_NGINX_MODULE_GEOIP_VERSION} \
nginx-module-image-filter=${APT_NGINX_MODULE_IMAGE_FILTER_VERSION} \
nginx-module-njs=${APT_NGINX_MODULE_NJS_VERSION} \
nginx-module-xslt=${APT_NGINX_MODULE_XSLT_VERSION} && \
# Cleanup
apt-get clean && \
rm -rf /var/lib/apt/lists/*
Expand Down
17 changes: 4 additions & 13 deletions versions.conf
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
export NODE20_VERSION=20.12.2
export NODE20_VERSION=20.17.0
# Nginx version
export NGINX_VERSION=1.24.0
export NGINX_NJS_VERSION=0.8.3
export NGINX_PKG_RELEASE=1~bookworm
export NGINX_VERSION=1.26.2
# Supervisor version
export SUPERVISOR_VERSION=4.2.5
export SUPERVISOR_PKG_RELEASE=1
# AuditJS version
export AUDITJS_VERSION=4.0.45
# NPM version
export NPM_VERSION=10.5.2
# Yarn version
export YARN_VERSION=4.1.1
# Browsers
export CHROME_VERSION=124.0.6367.60
export FIREFOX_VERSION=125.0.1
export CHROME_VERSION=128.0.6613.113
export FIREFOX_VERSION=129.0.2

0 comments on commit a8d921c

Please sign in to comment.