Skip to content

Commit

Permalink
Update node20 and add node22 LTS support
Browse files Browse the repository at this point in the history
  • Loading branch information
stankolubomir committed Nov 22, 2024
1 parent a8d921c commit dca9ab9
Show file tree
Hide file tree
Showing 33 changed files with 2,163 additions and 8 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,81 @@ jobs:
push: true
tags: anzusystems/node:${{ github.ref_name }}-node20-nginx-browsers,anzusystems/node:latest-node20-nginx-browsers

node22-base:
name: Build and push node22 base image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./build/node22/base
file: ./build/node22/base/Dockerfile
cache-from: type=gha,scope=node22
cache-to: type=gha,scope=node22,mode=max
push: true
tags: anzusystems/node:${{ github.ref_name }}-node22,anzusystems/node:latest-node22

node22-nginx:
name: Build and push node22 nginx image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./build/node22/nginx
file: ./build/node22/nginx/Dockerfile
cache-from: type=gha,scope=node22-nginx
cache-to: type=gha,scope=node22-nginx,mode=max
push: true
tags: anzusystems/node:${{ github.ref_name }}-node22-nginx,anzusystems/node:latest-node22-nginx

node22-nginx-browsers:
name: Build and push node22 nginx-browsers image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./build/node22/nginx-browsers
file: ./build/node22/nginx-browsers/Dockerfile
cache-from: type=gha,scope=node22-nginx-browsers
cache-to: type=gha,scope=node22-nginx-browsers,mode=max
push: true
tags: anzusystems/node:${{ github.ref_name }}-node22-nginx-browsers,anzusystems/node:latest-node22-nginx-browsers

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Additionally, it contains [nginx](https://nginx.org/), [mariadb client](https://
## What's inside

- Node 20
- Node 22
- NPM
- Yarn
- AuditJS
Expand Down
2 changes: 1 addition & 1 deletion 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.17.0
FROM node:20.18.1

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

Expand Down
6 changes: 3 additions & 3 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.17.0
FROM node:20.18.1

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

Expand Down Expand Up @@ -187,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_128.0.6613.113-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_131.0.6778.85-1_amd64.deb" && \
apt-get update && \
dpkg -i /usr/src/google-chrome-stable_current_amd64.deb ; \
apt-get install -f -y && \
Expand All @@ -196,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/129.0.2/linux-x86_64/en-US/firefox-129.0.2.tar.bz2" && \
RUN wget -q -O /tmp/firefox.tar.bz2 "https://download-installer.cdn.mozilla.net/pub/firefox/releases/132.0.2/linux-x86_64/en-US/firefox-132.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
2 changes: 1 addition & 1 deletion 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.17.0
FROM node:20.18.1

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

Expand Down
104 changes: 104 additions & 0 deletions build/node22/base/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
#
# NOTE:
# THIS DOCKERFILE IS GENERATED VIA "update.sh".
# PLEASE DO NOT EDIT IT DIRECTLY!
# CHECK README FOR MORE INFO.
#
FROM node:22.17.0

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

# ----------------------------------------------------------------------------------------------------------------------
# ENVIRONMENT VARIABLES
# ----------------------------------------------------------------------------------------------------------------------
# Common environment variables
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" \
YARN_ENABLE_TELEMETRY=0 \
# Unset yarn version - it could break CI and we don't need it
YARN_VERSION=
# Packages
ENV RUN_DEPS="ca-certificates \
curl \
g++ \
gcc \
gettext-base \
git \
gnupg \
less \
logrotate \
lsb-release \
make \
openssh-client \
procps \
vim \
wget"

# ----------------------------------------------------------------------------------------------------------------------
# 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=${APT_SUPERVISOR_VERSION} && \
# Cleanup
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# ----------------------------------------------------------------------------------------------------------------------
# NPM
# Install static npm version
# ----------------------------------------------------------------------------------------------------------------------
RUN npm install --location=global npm@latest && \
npm install --location=global auditjs@latest && \
mkdir -p ${COREPACK_HOME} && \
corepack prepare yarn@stable --activate && \
corepack enable && \
# Node cache cleanup
npm cache clean --force && \
yarn cache clean --all

# ----------------------------------------------------------------------------------------------------------------------
# USER SETUP
# ----------------------------------------------------------------------------------------------------------------------
RUN sed -i 's/^#alias l/alias l/g' /home/node/.bashrc && \
echo "update-notifier=false" > /home/node/.npmrc && \
mkdir -p \
${YARN_CACHE_FOLDER} \
/usr/local/lib/node_modules \
/var/run/supervisor \
/var/www/html/var && \
chown node:node -R \
${COREPACK_HOME} \
${YARN_CACHE_FOLDER} \
/home/node/.npmrc \
/usr/local/bin \
/usr/local/lib/node_modules \
/var/run/supervisor \
/var/www/html

##<autogenerated>##
##</autogenerated>##

# ----------------------------------------------------------------------------------------------------------------------
# RUN CONFIGURATION
# ----------------------------------------------------------------------------------------------------------------------
COPY --chown=${CONFIG_OWNER_NAME}:${CONFIG_GROUP_NAME} ./etc /etc
COPY --chown=${CONFIG_OWNER_NAME}:${CONFIG_GROUP_NAME} ./usr /usr

# ----------------------------------------------------------------------------------------------------------------------
# RUN
# Run setup and entrypoint start
# ----------------------------------------------------------------------------------------------------------------------
WORKDIR /var/www/html

USER node

ENTRYPOINT ["docker-custom-entrypoint"]
23 changes: 23 additions & 0 deletions build/node22/base/etc/supervisor/supervisord.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[unix_http_server]
file=/var/run/supervisor/supervisor.sock
chmod=0700
username=docker
password=docker

[supervisorctl]
serverurl=unix:///var/run/supervisor/supervisor.sock
username=docker
password=docker

[supervisord]
nodaemon=true
logfile=/dev/stdout
logfile_maxbytes=0
pidfile=/var/run/supervisor/supervisord.pid
loglevel=info

[rpcinterface:supervisor]
supervisor.rpcinterface_factory=supervisor.rpcinterface:make_main_rpcinterface

[include]
files = /etc/supervisor/conf.d/*.conf
3 changes: 3 additions & 0 deletions build/node22/base/usr/local/bin/docker-custom-entrypoint
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

exec "$@"
Loading

0 comments on commit dca9ab9

Please sign in to comment.