Skip to content

Commit

Permalink
use nginx 1.25.3 and njs 0.8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
zsteinkamp committed Mar 11, 2024
1 parent bdab912 commit a9a012f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# syntax=docker/dockerfile:1
ARG NGINX_VERSION=1.24.0
ARG NGINX_VERSION=1.25.3
ARG NJS_VERSION=0.8.2

FROM node:18 AS builder
FROM node:20-bullseye AS builder
WORKDIR /app
COPY package.json package-lock.json ./
RUN --mount=type=cache,target=/app/.npm \
Expand All @@ -16,7 +17,7 @@ COPY ./examples/nginx.conf /etc/nginx/nginx.conf
RUN mkdir /etc/nginx/njs-acme
RUN chown nginx: /etc/nginx/njs-acme

# install the latest njs > 0.8.0 (not yet bundled with nginx-1.25.1)
# install the latest njs >= 0.8.1 (not yet bundled with nginx-1.25.2)
RUN --mount=type=cache,target=/var/cache/apt <<EOF
set -eux
export DEBIAN_FRONTEND=noninteractive
Expand All @@ -33,7 +34,7 @@ RUN --mount=type=cache,target=/var/cache/apt <<EOF
| tee /etc/apt/sources.list.d/nginx.list
apt update -qq
apt install -qq --yes --no-install-recommends --no-install-suggests \
nginx-module-njs
nginx-module-njs=${NGINX_VERSION}+${NJS_VERSION}-${PKG_RELEASE}
apt remove --purge --auto-remove --yes
rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/nginx.list
EOF
12 changes: 7 additions & 5 deletions dev/Dockerfile.nginx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG NGINX_VERSION=1.25.1
ARG NJS_VERSION=0.8.0
ARG NGINX_VERSION=1.25.2
ARG NJS_VERSION=0.8.1
FROM nginx:${NGINX_VERSION}
ARG NGINX_VERSION
ARG NJS_VERSION
Expand All @@ -14,9 +14,11 @@ RUN --mount=type=cache,target=/var/cache/apt <<EOF
apt-get remove --purge --auto-remove --yes
EOF

# As of 07/13/2023 NJS v0.8.0 is not included into nginx docker image.
# this a temprary to install it
# following installation steps from http://nginx.org/en/linux_packages.html#Debian
RUN echo nginx-module-njs=${NGINX_VERSION}+${NJS_VERSION}-${PKG_RELEASE}

# As of 09/28/2023 NJS v0.8.1 is not included into nginx docker image.
# this a temprary patch to install it following installation steps from
# http://nginx.org/en/linux_packages.html#Debian
RUN --mount=type=cache,target=/var/cache/apt <<EOF
set -eux
export DEBIAN_FRONTEND=noninteractive
Expand Down
10 changes: 8 additions & 2 deletions integration-tests/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# syntax=docker/dockerfile:1
FROM node:20-bullseye

ARG NGINX_VERSION=1.25.3
ARG NJS_VERSION=0.8.2

ENV NJS_ACME_DIR=/etc/nginx/njs-acme/

# installing nginx and njs so we can use it while running tests
RUN env

# install nginx and njs
RUN --mount=type=cache,target=/var/cache/apt <<EOF
set -eux
export DEBIAN_FRONTEND=noninteractive
Expand All @@ -20,7 +25,8 @@ RUN --mount=type=cache,target=/var/cache/apt <<EOF
| tee /etc/apt/sources.list.d/nginx.list
apt update -qq
apt install -qq --yes --no-install-recommends --no-install-suggests \
nginx nginx-module-njs
nginx=${NGINX_VERSION}-1~bullseye \
nginx-module-njs=${NGINX_VERSION}+${NJS_VERSION}-1~bullseye
apt remove --purge --auto-remove --yes
rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/nginx.list
EOF
Expand Down

0 comments on commit a9a012f

Please sign in to comment.