From 5fc04e68b586940683d970f6b391a09d025572cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Fri, 29 May 2026 18:11:17 +0200 Subject: [PATCH 1/2] Adding support for Node 26 --- .github/workflows/workflow.yml | 4 + Dockerfile.26-apache-bullseye | 226 +++++++++++++++++++++++++++ Dockerfile.26-apache-bullseye-build | 230 ++++++++++++++++++++++++++++ Dockerfile.26-bullseye | 134 ++++++++++++++++ Dockerfile.26-bullseye-build | 138 +++++++++++++++++ README.md | 4 + orbit.yml | 4 + utils/Dockerfile.blueprint | 3 +- 8 files changed, 742 insertions(+), 1 deletion(-) create mode 100644 Dockerfile.26-apache-bullseye create mode 100644 Dockerfile.26-apache-bullseye-build create mode 100644 Dockerfile.26-bullseye create mode 100644 Dockerfile.26-bullseye-build diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 25fe700..68e3947 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -21,21 +21,25 @@ jobs: - variant: '20-bullseye' - variant: '22-bullseye' - variant: '24-bullseye' + - variant: '26-bullseye' - variant: '16-apache-bullseye' - variant: '18-apache-bullseye' - variant: '20-apache-bullseye' - variant: '22-apache-bullseye' - variant: '24-apache-bullseye' + - variant: '26-apache-bullseye' - variant: '16-bullseye-build' - variant: '18-bullseye-build' - variant: '20-bullseye-build' - variant: '22-bullseye-build' - variant: '24-bullseye-build' + - variant: '26-bullseye-build' - variant: '16-apache-bullseye-build' - variant: '18-apache-bullseye-build' - variant: '20-apache-bullseye-build' - variant: '22-apache-bullseye-build' - variant: '24-apache-bullseye-build' + - variant: '26-apache-bullseye-build' runs-on: ubuntu-latest steps: - name: Set up QEMU diff --git a/Dockerfile.26-apache-bullseye b/Dockerfile.26-apache-bullseye new file mode 100644 index 0000000..0039400 --- /dev/null +++ b/Dockerfile.26-apache-bullseye @@ -0,0 +1,226 @@ +# DO NOT EDIT THIS FILE : Make yours changes in /utils/Dockerfile.blueprint) +FROM debian:bullseye-slim + +LABEL authors="Julien Neuhart , David Négrier " + +# |-------------------------------------------------------------------------- +# | Required libraries +# |-------------------------------------------------------------------------- +# | +# | Installs required libraries. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends curl git nano sudo ca-certificates procps libfontconfig tini --no-install-recommends + +# |-------------------------------------------------------------------------- +# | Supercronic +# |-------------------------------------------------------------------------- +# | +# | Supercronic is a drop-in replacement for cron (for containers). +# | + +RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.12/supercronic-linux-$( dpkg --print-architecture ) \ + && SUPERCRONIC=supercronic-linux-$( dpkg --print-architecture ) \ + && curl -fsSLO "$SUPERCRONIC_URL" \ + && chmod +x "$SUPERCRONIC" \ + && mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \ + && ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic + + # |-------------------------------------------------------------------------- + # | User + # |-------------------------------------------------------------------------- + # | + # | Define a default user with sudo rights. + # | + + RUN useradd -ms /bin/bash docker && adduser docker sudo + # Users in the sudoers group can sudo as root without password. + RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + + + +# |-------------------------------------------------------------------------- +# | Apache +# |-------------------------------------------------------------------------- +# | +# | Installs Apache. +# | + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + apache2 \ + && rm -rf /var/lib/apt/lists/* + +ENV APACHE_CONFDIR /etc/apache2 +ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars + +RUN set -ex \ + \ +# generically convert lines like +# export APACHE_RUN_USER=www-data +# into +# : ${APACHE_RUN_USER:=www-data} +# export APACHE_RUN_USER +# so that they can be overridden at runtime ("-e APACHE_RUN_USER=...") + && sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS" \ + \ +# setup directories and permissions + && . "$APACHE_ENVVARS" \ + && for dir in \ + "$APACHE_LOCK_DIR" \ + "$APACHE_RUN_DIR" \ + "$APACHE_LOG_DIR" \ + /var/www/html \ + ; do \ + rm -rvf "$dir" \ + && mkdir -p "$dir" \ + && chown -R "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir"; \ + done + +# logs should go to stdout / stderr +RUN set -ex \ + && . "$APACHE_ENVVARS" \ + && ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log" \ + && ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log" \ + && ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log" + +ENV APACHE_DOCUMENT_ROOT / + +RUN { \ + echo 'DirectoryIndex disabled'; \ + echo 'DirectoryIndex index.html'; \ + echo; \ + echo ''; \ + echo '\tOptions -Indexes'; \ + echo '\tAllowOverride All'; \ + echo ''; \ + } | tee "$APACHE_CONFDIR/conf-available/nodejs.conf" \ + && a2enconf nodejs + +RUN sed -ri -e 's!/var/www/html!/var/www/html/${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf +RUN sed -ri -e 's!/var/www/!/var/www/html/${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf + +# |-------------------------------------------------------------------------- +# | Apache mod_rewrite +# |-------------------------------------------------------------------------- +# | +# | Enables Apache mod_rewrite. +# | + +RUN a2enmod rewrite + + +# |-------------------------------------------------------------------------- +# | NodeJS +# |-------------------------------------------------------------------------- +# | +# | Installs NodeJS and npm. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends gnupg &&\ + mkdir -p /etc/apt/keyrings && \ + curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ + echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_26.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list &&\ + apt-get update &&\ + apt-get install -y --no-install-recommends nodejs&& \ + npm install -g corepack@latest + +# |-------------------------------------------------------------------------- +# | yarn +# |-------------------------------------------------------------------------- +# | +# | Installs yarn. It provides some nice improvements over npm. +# | + +RUN corepack enable && corepack prepare yarn@stable --activate + +# |-------------------------------------------------------------------------- +# | PATH updating +# |-------------------------------------------------------------------------- +# | +# | Let's add ./node_modules/.bin to the PATH (utility function to use NPM bin easily) +# | + +ENV PATH="$PATH:./node_modules/.bin" +RUN sed -i 's#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:./node_modules/.bin#g' /etc/sudoers + +USER docker +# |-------------------------------------------------------------------------- +# | SSH client +# |-------------------------------------------------------------------------- +# | +# | Let's set-up the SSH client (for connections to private git repositories) +# | We create an empty known_host file and we launch the ssh-agent +# | + +RUN mkdir ~/.ssh && touch ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts && eval $(ssh-agent -s) + +# |-------------------------------------------------------------------------- +# | .bashrc updating +# |-------------------------------------------------------------------------- +# | +# | Let's update the .bashrc to add nice aliases +# | +RUN { \ + echo "alias ls='ls --color=auto'"; \ + echo "alias ll='ls --color=auto -alF'"; \ + echo "alias la='ls --color=auto -A'"; \ + echo "alias l='ls --color=auto -CF'"; \ + } >> ~/.bashrc + +USER root + +# |-------------------------------------------------------------------------- +# | Entrypoint +# |-------------------------------------------------------------------------- +# | +# | Defines the entrypoint. +# | + +ENV NODE_VERSION=26.x + + +RUN mkdir -p /var/www/html && chown docker:docker /var/www/html +WORKDIR /var/www/html + + +COPY utils/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh +COPY utils/docker-entrypoint-as-root.sh /usr/local/bin/docker-entrypoint-as-root.sh +COPY utils/startup_commands.js /usr/local/bin/startup_commands.js +COPY utils/generate_cron.js /usr/local/bin/generate_cron.js + + + +COPY utils/enable_apache_mods.js /usr/local/bin/enable_apache_mods.js +COPY utils/apache-expose-envvars.sh /usr/local/bin/apache-expose-envvars.sh + +# Let's register a servername to remove the message "apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message" +RUN echo "ServerName localhost" > /etc/apache2/conf-available/servername.conf +RUN a2enconf servername + +EXPOSE 80 + +# |-------------------------------------------------------------------------- +# | Apache user +# |-------------------------------------------------------------------------- +# | +# | Defines Apache user. By default, we switch this to "docker" user. +# | This way, no problem to write from Apache in the current working directory. +# | Important! This should be changed back to www-data in production. +# | + +ENV APACHE_RUN_USER=docker \ + APACHE_RUN_GROUP=docker + +COPY utils/apache2-foreground /usr/local/bin/ +CMD ["apache2-foreground"] + + + + +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] + + +USER docker diff --git a/Dockerfile.26-apache-bullseye-build b/Dockerfile.26-apache-bullseye-build new file mode 100644 index 0000000..dd4c730 --- /dev/null +++ b/Dockerfile.26-apache-bullseye-build @@ -0,0 +1,230 @@ +# DO NOT EDIT THIS FILE : Make yours changes in /utils/Dockerfile.blueprint) +FROM debian:bullseye-slim + +LABEL authors="Julien Neuhart , David Négrier " + +# |-------------------------------------------------------------------------- +# | Required libraries +# |-------------------------------------------------------------------------- +# | +# | Installs required libraries. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends curl git nano sudo ca-certificates procps libfontconfig tini --no-install-recommends + +# |-------------------------------------------------------------------------- +# | Supercronic +# |-------------------------------------------------------------------------- +# | +# | Supercronic is a drop-in replacement for cron (for containers). +# | + +RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.12/supercronic-linux-$( dpkg --print-architecture ) \ + && SUPERCRONIC=supercronic-linux-$( dpkg --print-architecture ) \ + && curl -fsSLO "$SUPERCRONIC_URL" \ + && chmod +x "$SUPERCRONIC" \ + && mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \ + && ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic + + # |-------------------------------------------------------------------------- + # | User + # |-------------------------------------------------------------------------- + # | + # | Define a default user with sudo rights. + # | + + RUN useradd -ms /bin/bash docker && adduser docker sudo + # Users in the sudoers group can sudo as root without password. + RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + + + +# |-------------------------------------------------------------------------- +# | Apache +# |-------------------------------------------------------------------------- +# | +# | Installs Apache. +# | + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + apache2 \ + && rm -rf /var/lib/apt/lists/* + +ENV APACHE_CONFDIR /etc/apache2 +ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars + +RUN set -ex \ + \ +# generically convert lines like +# export APACHE_RUN_USER=www-data +# into +# : ${APACHE_RUN_USER:=www-data} +# export APACHE_RUN_USER +# so that they can be overridden at runtime ("-e APACHE_RUN_USER=...") + && sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS" \ + \ +# setup directories and permissions + && . "$APACHE_ENVVARS" \ + && for dir in \ + "$APACHE_LOCK_DIR" \ + "$APACHE_RUN_DIR" \ + "$APACHE_LOG_DIR" \ + /var/www/html \ + ; do \ + rm -rvf "$dir" \ + && mkdir -p "$dir" \ + && chown -R "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir"; \ + done + +# logs should go to stdout / stderr +RUN set -ex \ + && . "$APACHE_ENVVARS" \ + && ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log" \ + && ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log" \ + && ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log" + +ENV APACHE_DOCUMENT_ROOT / + +RUN { \ + echo 'DirectoryIndex disabled'; \ + echo 'DirectoryIndex index.html'; \ + echo; \ + echo ''; \ + echo '\tOptions -Indexes'; \ + echo '\tAllowOverride All'; \ + echo ''; \ + } | tee "$APACHE_CONFDIR/conf-available/nodejs.conf" \ + && a2enconf nodejs + +RUN sed -ri -e 's!/var/www/html!/var/www/html/${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf +RUN sed -ri -e 's!/var/www/!/var/www/html/${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf + +# |-------------------------------------------------------------------------- +# | Apache mod_rewrite +# |-------------------------------------------------------------------------- +# | +# | Enables Apache mod_rewrite. +# | + +RUN a2enmod rewrite + + +# |-------------------------------------------------------------------------- +# | NodeJS +# |-------------------------------------------------------------------------- +# | +# | Installs NodeJS and npm. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends gnupg &&\ + mkdir -p /etc/apt/keyrings && \ + curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ + echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_26.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list &&\ + apt-get update &&\ + apt-get install -y --no-install-recommends nodejs&& \ + npm install -g corepack@latest + +# |-------------------------------------------------------------------------- +# | yarn +# |-------------------------------------------------------------------------- +# | +# | Installs yarn. It provides some nice improvements over npm. +# | + +RUN corepack enable && corepack prepare yarn@stable --activate + +# |-------------------------------------------------------------------------- +# | PATH updating +# |-------------------------------------------------------------------------- +# | +# | Let's add ./node_modules/.bin to the PATH (utility function to use NPM bin easily) +# | + +ENV PATH="$PATH:./node_modules/.bin" +RUN sed -i 's#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:./node_modules/.bin#g' /etc/sudoers + +USER docker +# |-------------------------------------------------------------------------- +# | SSH client +# |-------------------------------------------------------------------------- +# | +# | Let's set-up the SSH client (for connections to private git repositories) +# | We create an empty known_host file and we launch the ssh-agent +# | + +RUN mkdir ~/.ssh && touch ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts && eval $(ssh-agent -s) + +# |-------------------------------------------------------------------------- +# | .bashrc updating +# |-------------------------------------------------------------------------- +# | +# | Let's update the .bashrc to add nice aliases +# | +RUN { \ + echo "alias ls='ls --color=auto'"; \ + echo "alias ll='ls --color=auto -alF'"; \ + echo "alias la='ls --color=auto -A'"; \ + echo "alias l='ls --color=auto -CF'"; \ + } >> ~/.bashrc + +USER root + +# |-------------------------------------------------------------------------- +# | Entrypoint +# |-------------------------------------------------------------------------- +# | +# | Defines the entrypoint. +# | + +ENV NODE_VERSION=26.x + + +RUN mkdir -p /var/www/html && chown docker:docker /var/www/html +WORKDIR /var/www/html + + +COPY utils/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh +COPY utils/docker-entrypoint-as-root.sh /usr/local/bin/docker-entrypoint-as-root.sh +COPY utils/startup_commands.js /usr/local/bin/startup_commands.js +COPY utils/generate_cron.js /usr/local/bin/generate_cron.js + + + +COPY utils/enable_apache_mods.js /usr/local/bin/enable_apache_mods.js +COPY utils/apache-expose-envvars.sh /usr/local/bin/apache-expose-envvars.sh + +# Let's register a servername to remove the message "apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message" +RUN echo "ServerName localhost" > /etc/apache2/conf-available/servername.conf +RUN a2enconf servername + +EXPOSE 80 + +# |-------------------------------------------------------------------------- +# | Apache user +# |-------------------------------------------------------------------------- +# | +# | Defines Apache user. By default, we switch this to "docker" user. +# | This way, no problem to write from Apache in the current working directory. +# | Important! This should be changed back to www-data in production. +# | + +ENV APACHE_RUN_USER=docker \ + APACHE_RUN_GROUP=docker + +COPY utils/apache2-foreground /usr/local/bin/ +CMD ["apache2-foreground"] + + + +# Let's install the build tools (useful for node-gyp) +RUN apt-get update &&\ + apt-get install -y --no-install-recommends build-essential + + +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] + + +USER docker diff --git a/Dockerfile.26-bullseye b/Dockerfile.26-bullseye new file mode 100644 index 0000000..6e234f7 --- /dev/null +++ b/Dockerfile.26-bullseye @@ -0,0 +1,134 @@ +# DO NOT EDIT THIS FILE : Make yours changes in /utils/Dockerfile.blueprint) +FROM debian:bullseye-slim + +LABEL authors="Julien Neuhart , David Négrier " + +# |-------------------------------------------------------------------------- +# | Required libraries +# |-------------------------------------------------------------------------- +# | +# | Installs required libraries. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends curl git nano sudo ca-certificates procps libfontconfig tini --no-install-recommends + +# |-------------------------------------------------------------------------- +# | Supercronic +# |-------------------------------------------------------------------------- +# | +# | Supercronic is a drop-in replacement for cron (for containers). +# | + +RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.12/supercronic-linux-$( dpkg --print-architecture ) \ + && SUPERCRONIC=supercronic-linux-$( dpkg --print-architecture ) \ + && curl -fsSLO "$SUPERCRONIC_URL" \ + && chmod +x "$SUPERCRONIC" \ + && mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \ + && ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic + + # |-------------------------------------------------------------------------- + # | User + # |-------------------------------------------------------------------------- + # | + # | Define a default user with sudo rights. + # | + + RUN useradd -ms /bin/bash docker && adduser docker sudo + # Users in the sudoers group can sudo as root without password. + RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + + + + +# |-------------------------------------------------------------------------- +# | NodeJS +# |-------------------------------------------------------------------------- +# | +# | Installs NodeJS and npm. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends gnupg &&\ + mkdir -p /etc/apt/keyrings && \ + curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ + echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_26.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list &&\ + apt-get update &&\ + apt-get install -y --no-install-recommends nodejs&& \ + npm install -g corepack@latest + +# |-------------------------------------------------------------------------- +# | yarn +# |-------------------------------------------------------------------------- +# | +# | Installs yarn. It provides some nice improvements over npm. +# | + +RUN corepack enable && corepack prepare yarn@stable --activate + +# |-------------------------------------------------------------------------- +# | PATH updating +# |-------------------------------------------------------------------------- +# | +# | Let's add ./node_modules/.bin to the PATH (utility function to use NPM bin easily) +# | + +ENV PATH="$PATH:./node_modules/.bin" +RUN sed -i 's#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:./node_modules/.bin#g' /etc/sudoers + +USER docker +# |-------------------------------------------------------------------------- +# | SSH client +# |-------------------------------------------------------------------------- +# | +# | Let's set-up the SSH client (for connections to private git repositories) +# | We create an empty known_host file and we launch the ssh-agent +# | + +RUN mkdir ~/.ssh && touch ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts && eval $(ssh-agent -s) + +# |-------------------------------------------------------------------------- +# | .bashrc updating +# |-------------------------------------------------------------------------- +# | +# | Let's update the .bashrc to add nice aliases +# | +RUN { \ + echo "alias ls='ls --color=auto'"; \ + echo "alias ll='ls --color=auto -alF'"; \ + echo "alias la='ls --color=auto -A'"; \ + echo "alias l='ls --color=auto -CF'"; \ + } >> ~/.bashrc + +USER root + +# |-------------------------------------------------------------------------- +# | Entrypoint +# |-------------------------------------------------------------------------- +# | +# | Defines the entrypoint. +# | + +ENV NODE_VERSION=26.x + + +RUN mkdir -p /usr/src/app && chown docker:docker /usr/src/app +WORKDIR /usr/src/app + + +COPY utils/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh +COPY utils/docker-entrypoint-as-root.sh /usr/local/bin/docker-entrypoint-as-root.sh +COPY utils/startup_commands.js /usr/local/bin/startup_commands.js +COPY utils/generate_cron.js /usr/local/bin/generate_cron.js + + + +CMD [ "node" ] + + + + +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] + + +USER docker diff --git a/Dockerfile.26-bullseye-build b/Dockerfile.26-bullseye-build new file mode 100644 index 0000000..ebeb6b1 --- /dev/null +++ b/Dockerfile.26-bullseye-build @@ -0,0 +1,138 @@ +# DO NOT EDIT THIS FILE : Make yours changes in /utils/Dockerfile.blueprint) +FROM debian:bullseye-slim + +LABEL authors="Julien Neuhart , David Négrier " + +# |-------------------------------------------------------------------------- +# | Required libraries +# |-------------------------------------------------------------------------- +# | +# | Installs required libraries. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends curl git nano sudo ca-certificates procps libfontconfig tini --no-install-recommends + +# |-------------------------------------------------------------------------- +# | Supercronic +# |-------------------------------------------------------------------------- +# | +# | Supercronic is a drop-in replacement for cron (for containers). +# | + +RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.12/supercronic-linux-$( dpkg --print-architecture ) \ + && SUPERCRONIC=supercronic-linux-$( dpkg --print-architecture ) \ + && curl -fsSLO "$SUPERCRONIC_URL" \ + && chmod +x "$SUPERCRONIC" \ + && mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \ + && ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic + + # |-------------------------------------------------------------------------- + # | User + # |-------------------------------------------------------------------------- + # | + # | Define a default user with sudo rights. + # | + + RUN useradd -ms /bin/bash docker && adduser docker sudo + # Users in the sudoers group can sudo as root without password. + RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + + + + +# |-------------------------------------------------------------------------- +# | NodeJS +# |-------------------------------------------------------------------------- +# | +# | Installs NodeJS and npm. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends gnupg &&\ + mkdir -p /etc/apt/keyrings && \ + curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ + echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_26.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list &&\ + apt-get update &&\ + apt-get install -y --no-install-recommends nodejs&& \ + npm install -g corepack@latest + +# |-------------------------------------------------------------------------- +# | yarn +# |-------------------------------------------------------------------------- +# | +# | Installs yarn. It provides some nice improvements over npm. +# | + +RUN corepack enable && corepack prepare yarn@stable --activate + +# |-------------------------------------------------------------------------- +# | PATH updating +# |-------------------------------------------------------------------------- +# | +# | Let's add ./node_modules/.bin to the PATH (utility function to use NPM bin easily) +# | + +ENV PATH="$PATH:./node_modules/.bin" +RUN sed -i 's#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:./node_modules/.bin#g' /etc/sudoers + +USER docker +# |-------------------------------------------------------------------------- +# | SSH client +# |-------------------------------------------------------------------------- +# | +# | Let's set-up the SSH client (for connections to private git repositories) +# | We create an empty known_host file and we launch the ssh-agent +# | + +RUN mkdir ~/.ssh && touch ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts && eval $(ssh-agent -s) + +# |-------------------------------------------------------------------------- +# | .bashrc updating +# |-------------------------------------------------------------------------- +# | +# | Let's update the .bashrc to add nice aliases +# | +RUN { \ + echo "alias ls='ls --color=auto'"; \ + echo "alias ll='ls --color=auto -alF'"; \ + echo "alias la='ls --color=auto -A'"; \ + echo "alias l='ls --color=auto -CF'"; \ + } >> ~/.bashrc + +USER root + +# |-------------------------------------------------------------------------- +# | Entrypoint +# |-------------------------------------------------------------------------- +# | +# | Defines the entrypoint. +# | + +ENV NODE_VERSION=26.x + + +RUN mkdir -p /usr/src/app && chown docker:docker /usr/src/app +WORKDIR /usr/src/app + + +COPY utils/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh +COPY utils/docker-entrypoint-as-root.sh /usr/local/bin/docker-entrypoint-as-root.sh +COPY utils/startup_commands.js /usr/local/bin/startup_commands.js +COPY utils/generate_cron.js /usr/local/bin/generate_cron.js + + + +CMD [ "node" ] + + + +# Let's install the build tools (useful for node-gyp) +RUN apt-get update &&\ + apt-get install -y --no-install-recommends build-essential + + +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] + + +USER docker diff --git a/README.md b/README.md index 4dc349b..7403355 100644 --- a/README.md +++ b/README.md @@ -19,21 +19,25 @@ This repository contains a set of **fat**, developer-friendly, general purpose N | [thecodingmachine/nodejs:v2-20-bullseye](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.20-bullseye)
[ghcr.io/thecodingmachine/nodejs:v2-20-bullseye](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.20-bullseye) | `20.x` | standalone | No | Debian Bullseye | | [thecodingmachine/nodejs:v2-22-bullseye](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.22-bullseye)
[ghcr.io/thecodingmachine/nodejs:v2-22-bullseye](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.22-bullseye) | `22.x` | standalone | No | Debian Bullseye | | [thecodingmachine/nodejs:v2-24-bullseye](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.24-bullseye)
[ghcr.io/thecodingmachine/nodejs:v2-24-bullseye](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.24-bullseye) | `24.x` | standalone | No | Debian Bullseye | +| [thecodingmachine/nodejs:v2-26-bullseye](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.26-bullseye)
[ghcr.io/thecodingmachine/nodejs:v2-26-bullseye](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.26-bullseye) | `26.x` | standalone | No | Debian Bullseye | | [thecodingmachine/nodejs:v2-16-bullseye-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.16-bullseye-build)
[ghcr.io/thecodingmachine/nodejs:v2-16-bullseye-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.16-bullseye-build) | `16.x` | standalone | Yes | Debian Bullseye | | [thecodingmachine/nodejs:v2-18-bullseye-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.18-bullseye-build)
[ghcr.io/thecodingmachine/nodejs:v2-18-bullseye-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.18-bullseye-build) | `18.x` | standalone | Yes | Debian Bullseye | | [thecodingmachine/nodejs:v2-20-bullseye-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.20-bullseye-build)
[ghcr.io/thecodingmachine/nodejs:v2-20-bullseye-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.20-bullseye-build) | `20.x` | standalone | Yes | Debian Bullseye | | [thecodingmachine/nodejs:v2-22-bullseye-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.22-bullseye-build)
[ghcr.io/thecodingmachine/nodejs:v2-22-bullseye-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.22-bullseye-build) | `22.x` | standalone | Yes | Debian Bullseye | | [thecodingmachine/nodejs:v2-24-bullseye-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.24-bullseye-build)
[ghcr.io/thecodingmachine/nodejs:v2-24-bullseye-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.24-bullseye-build) | `24.x` | standalone | Yes | Debian Bullseye | +| [thecodingmachine/nodejs:v2-26-bullseye-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.26-bullseye-build)
[ghcr.io/thecodingmachine/nodejs:v2-26-bullseye-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.26-bullseye-build) | `26.x` | standalone | Yes | Debian Bullseye | | [thecodingmachine/nodejs:v2-16-apache-bullseye](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.16-apache-bullseye)
[ghcr.io/thecodingmachine/nodejs:v2-16-apache-bullseye](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.16-apache-bullseye) | `16.x` | apache | No | Debian Bullseye | | [thecodingmachine/nodejs:v2-18-apache-bullseye](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.18-apache-bullseye)
[ghcr.io/thecodingmachine/nodejs:v2-18-apache-bullseye](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.18-apache-bullseye) | `18.x` | apache | No | Debian Bullseye | | [thecodingmachine/nodejs:v2-20-apache-bullseye](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.20-apache-bullseye)
[ghcr.io/thecodingmachine/nodejs:v2-20-apache-bullseye](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.20-apache-bullseye) | `20.x` | apache | No | Debian Bullseye | | [thecodingmachine/nodejs:v2-22-apache-bullseye](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.22-apache-bullseye)
[ghcr.io/thecodingmachine/nodejs:v2-22-apache-bullseye](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.22-apache-bullseye) | `22.x` | apache | No | Debian Bullseye | | [thecodingmachine/nodejs:v2-24-apache-bullseye](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.24-apache-bullseye)
[ghcr.io/thecodingmachine/nodejs:v2-24-apache-bullseye](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.24-apache-bullseye) | `24.x` | apache | No | Debian Bullseye | +| [thecodingmachine/nodejs:v2-26-apache-bullseye](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.26-apache-bullseye)
[ghcr.io/thecodingmachine/nodejs:v2-26-apache-bullseye](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.26-apache-bullseye) | `26.x` | apache | No | Debian Bullseye | | [thecodingmachine/nodejs:v2-16-apache-bullseye-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.16-apache-bullseye-build)
[ghcr.io/thecodingmachine/nodejs:v2-16-apache-bullseye-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.16-apache-bullseye-build) | `16.x` | apache | Yes | Debian Bullseye | | [thecodingmachine/nodejs:v2-18-apache-bullseye-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.18-apache-bullseye-build)
[ghcr.io/thecodingmachine/nodejs:v2-18-apache-bullseye-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.18-apache-bullseye-build) | `18.x` | apache | Yes | Debian Bullseye | | [thecodingmachine/nodejs:v2-20-apache-bullseye-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.20-apache-bullseye-build)
[ghcr.io/thecodingmachine/nodejs:v2-20-apache-bullseye-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.20-apache-bullseye-build) | `20.x` | apache | Yes | Debian Bullseye | | [thecodingmachine/nodejs:v2-22-apache-bullseye-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.22-apache-bullseye-build)
[ghcr.io/thecodingmachine/nodejs:v2-22-apache-bullseye-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.22-apache-bullseye-build) | `22.x` | apache | Yes | Debian Bullseye | | [thecodingmachine/nodejs:v2-24-apache-bullseye-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.24-apache-bullseye-build)
[ghcr.io/thecodingmachine/nodejs:v2-24-apache-bullseye-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.24-apache-bullseye-build) | `24.x` | apache | Yes | Debian Bullseye | +| [thecodingmachine/nodejs:v2-26-apache-bullseye-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.26-apache-bullseye-build)
[ghcr.io/thecodingmachine/nodejs:v2-26-apache-bullseye-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.26-apache-bullseye-build) | `26.x` | apache | Yes | Debian Bullseye | Note: we do not tag minor releases of NodeJS, only major versions. You will find for example an image for NodeJS 18.x, but no tagged image for NodeJS 18.2. This is because NodeJS follows SemVer and we believe you have no valid reason to ask explicitly for 18.2. diff --git a/orbit.yml b/orbit.yml index 745ed96..4c61ef0 100644 --- a/orbit.yml +++ b/orbit.yml @@ -24,20 +24,24 @@ tasks: - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.20-bullseye -p "NodeVersion,20;Variant,standalone;BaseImage,debian:bullseye-slim;Build,false" - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.22-bullseye -p "NodeVersion,22;Variant,standalone;BaseImage,debian:bullseye-slim;Build,false" - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.24-bullseye -p "NodeVersion,24;Variant,standalone;BaseImage,debian:bullseye-slim;Build,false" + - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.26-bullseye -p "NodeVersion,26;Variant,standalone;BaseImage,debian:bullseye-slim;Build,false" - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.16-apache-bullseye -p "NodeVersion,16;Variant,apache;BaseImage,debian:bullseye-slim;Build,false" - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.18-apache-bullseye -p "NodeVersion,18;Variant,apache;BaseImage,debian:bullseye-slim;Build,false" - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.20-apache-bullseye -p "NodeVersion,20;Variant,apache;BaseImage,debian:bullseye-slim;Build,false" - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.22-apache-bullseye -p "NodeVersion,22;Variant,apache;BaseImage,debian:bullseye-slim;Build,false" - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.24-apache-bullseye -p "NodeVersion,24;Variant,apache;BaseImage,debian:bullseye-slim;Build,false" + - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.26-apache-bullseye -p "NodeVersion,26;Variant,apache;BaseImage,debian:bullseye-slim;Build,false" - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.16-bullseye-build -p "NodeVersion,16;Variant,standalone;BaseImage,debian:bullseye-slim;Build,true" - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.18-bullseye-build -p "NodeVersion,18;Variant,standalone;BaseImage,debian:bullseye-slim;Build,true" - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.20-bullseye-build -p "NodeVersion,20;Variant,standalone;BaseImage,debian:bullseye-slim;Build,true" - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.22-bullseye-build -p "NodeVersion,22;Variant,standalone;BaseImage,debian:bullseye-slim;Build,true" - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.24-bullseye-build -p "NodeVersion,24;Variant,standalone;BaseImage,debian:bullseye-slim;Build,true" + - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.26-bullseye-build -p "NodeVersion,26;Variant,standalone;BaseImage,debian:bullseye-slim;Build,true" - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.16-apache-bullseye-build -p "NodeVersion,16;Variant,apache;BaseImage,debian:bullseye-slim;Build,true" - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.18-apache-bullseye-build -p "NodeVersion,18;Variant,apache;BaseImage,debian:bullseye-slim;Build,true" - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.20-apache-bullseye-build -p "NodeVersion,20;Variant,apache;BaseImage,debian:bullseye-slim;Build,true" - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.22-apache-bullseye-build -p "NodeVersion,22;Variant,apache;BaseImage,debian:bullseye-slim;Build,true" - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.24-apache-bullseye-build -p "NodeVersion,24;Variant,apache;BaseImage,debian:bullseye-slim;Build,true" + - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.26-apache-bullseye-build -p "NodeVersion,26;Variant,apache;BaseImage,debian:bullseye-slim;Build,true" - |- sed -i '1i\# DO NOT EDIT THIS FILE : Make yours changes in /utils/Dockerfile.blueprint)' Dockerfile.* diff --git a/utils/Dockerfile.blueprint b/utils/Dockerfile.blueprint index 65d4a0f..478e6e2 100644 --- a/utils/Dockerfile.blueprint +++ b/utils/Dockerfile.blueprint @@ -128,7 +128,8 @@ RUN apt-get update &&\ curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_{{ $node_version }}.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list &&\{{ end }} apt-get update &&\ - apt-get install -y --no-install-recommends nodejs + apt-get install -y --no-install-recommends nodejs{{ if ge $node_version "26" }}&& \ + npm install -g corepack@latest{{ end }} # |-------------------------------------------------------------------------- # | yarn From 264c73fcf743c1cb9f9854555f335b99582f8ca5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Mon, 1 Jun 2026 09:31:33 +0200 Subject: [PATCH 2/2] Adding Debian Trixie variants In addition to Bullseye, we now add Debian Trixie images --- .github/workflows/workflow.yml | 16 ++ Dockerfile.16-apache-bullseye | 4 +- Dockerfile.16-apache-bullseye-build | 4 +- Dockerfile.16-bullseye | 4 +- Dockerfile.16-bullseye-build | 4 +- Dockerfile.18-apache-bullseye | 4 +- Dockerfile.18-apache-bullseye-build | 4 +- Dockerfile.18-bullseye | 4 +- Dockerfile.18-bullseye-build | 4 +- Dockerfile.20-apache-bullseye | 4 +- Dockerfile.20-apache-bullseye-build | 4 +- Dockerfile.20-apache-trixie | 225 +++++++++++++++++++++++++++ Dockerfile.20-apache-trixie-build | 229 +++++++++++++++++++++++++++ Dockerfile.20-bullseye | 4 +- Dockerfile.20-bullseye-build | 4 +- Dockerfile.20-trixie | 133 ++++++++++++++++ Dockerfile.20-trixie-build | 137 +++++++++++++++++ Dockerfile.22-apache-bullseye | 4 +- Dockerfile.22-apache-bullseye-build | 4 +- Dockerfile.22-apache-trixie | 225 +++++++++++++++++++++++++++ Dockerfile.22-apache-trixie-build | 229 +++++++++++++++++++++++++++ Dockerfile.22-bullseye | 4 +- Dockerfile.22-bullseye-build | 4 +- Dockerfile.22-trixie | 133 ++++++++++++++++ Dockerfile.22-trixie-build | 137 +++++++++++++++++ Dockerfile.24-apache-bullseye | 4 +- Dockerfile.24-apache-bullseye-build | 4 +- Dockerfile.24-apache-trixie | 225 +++++++++++++++++++++++++++ Dockerfile.24-apache-trixie-build | 229 +++++++++++++++++++++++++++ Dockerfile.24-bullseye | 4 +- Dockerfile.24-bullseye-build | 4 +- Dockerfile.24-trixie | 133 ++++++++++++++++ Dockerfile.24-trixie-build | 137 +++++++++++++++++ Dockerfile.26-apache-bullseye | 6 +- Dockerfile.26-apache-bullseye-build | 6 +- Dockerfile.26-apache-trixie | 226 +++++++++++++++++++++++++++ Dockerfile.26-apache-trixie-build | 230 ++++++++++++++++++++++++++++ Dockerfile.26-bullseye | 6 +- Dockerfile.26-bullseye-build | 6 +- Dockerfile.26-trixie | 134 ++++++++++++++++ Dockerfile.26-trixie-build | 138 +++++++++++++++++ README.md | 20 ++- orbit.yml | 18 ++- utils/Dockerfile.blueprint | 4 +- 44 files changed, 3005 insertions(+), 57 deletions(-) create mode 100644 Dockerfile.20-apache-trixie create mode 100644 Dockerfile.20-apache-trixie-build create mode 100644 Dockerfile.20-trixie create mode 100644 Dockerfile.20-trixie-build create mode 100644 Dockerfile.22-apache-trixie create mode 100644 Dockerfile.22-apache-trixie-build create mode 100644 Dockerfile.22-trixie create mode 100644 Dockerfile.22-trixie-build create mode 100644 Dockerfile.24-apache-trixie create mode 100644 Dockerfile.24-apache-trixie-build create mode 100644 Dockerfile.24-trixie create mode 100644 Dockerfile.24-trixie-build create mode 100644 Dockerfile.26-apache-trixie create mode 100644 Dockerfile.26-apache-trixie-build create mode 100644 Dockerfile.26-trixie create mode 100644 Dockerfile.26-trixie-build diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 68e3947..9708ae8 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -40,6 +40,22 @@ jobs: - variant: '22-apache-bullseye-build' - variant: '24-apache-bullseye-build' - variant: '26-apache-bullseye-build' + - variant: '20-trixie' + - variant: '22-trixie' + - variant: '24-trixie' + - variant: '26-trixie' + - variant: '20-apache-trixie' + - variant: '22-apache-trixie' + - variant: '24-apache-trixie' + - variant: '26-apache-trixie' + - variant: '20-trixie-build' + - variant: '22-trixie-build' + - variant: '24-trixie-build' + - variant: '26-trixie-build' + - variant: '20-apache-trixie-build' + - variant: '22-apache-trixie-build' + - variant: '24-apache-trixie-build' + - variant: '26-apache-trixie-build' runs-on: ubuntu-latest steps: - name: Set up QEMU diff --git a/Dockerfile.16-apache-bullseye b/Dockerfile.16-apache-bullseye index 9e653a5..ecc2a6e 100644 --- a/Dockerfile.16-apache-bullseye +++ b/Dockerfile.16-apache-bullseye @@ -1,4 +1,4 @@ -# DO NOT EDIT THIS FILE : Make yours changes in /utils/Dockerfile.blueprint) +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) FROM debian:bullseye-slim LABEL authors="Julien Neuhart , David Négrier " @@ -34,7 +34,7 @@ RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0. # | Define a default user with sudo rights. # | - RUN useradd -ms /bin/bash docker && adduser docker sudo + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker # Users in the sudoers group can sudo as root without password. RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers diff --git a/Dockerfile.16-apache-bullseye-build b/Dockerfile.16-apache-bullseye-build index d70f250..3c26f65 100644 --- a/Dockerfile.16-apache-bullseye-build +++ b/Dockerfile.16-apache-bullseye-build @@ -1,4 +1,4 @@ -# DO NOT EDIT THIS FILE : Make yours changes in /utils/Dockerfile.blueprint) +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) FROM debian:bullseye-slim LABEL authors="Julien Neuhart , David Négrier " @@ -34,7 +34,7 @@ RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0. # | Define a default user with sudo rights. # | - RUN useradd -ms /bin/bash docker && adduser docker sudo + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker # Users in the sudoers group can sudo as root without password. RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers diff --git a/Dockerfile.16-bullseye b/Dockerfile.16-bullseye index c57ba90..efa512f 100644 --- a/Dockerfile.16-bullseye +++ b/Dockerfile.16-bullseye @@ -1,4 +1,4 @@ -# DO NOT EDIT THIS FILE : Make yours changes in /utils/Dockerfile.blueprint) +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) FROM debian:bullseye-slim LABEL authors="Julien Neuhart , David Négrier " @@ -34,7 +34,7 @@ RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0. # | Define a default user with sudo rights. # | - RUN useradd -ms /bin/bash docker && adduser docker sudo + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker # Users in the sudoers group can sudo as root without password. RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers diff --git a/Dockerfile.16-bullseye-build b/Dockerfile.16-bullseye-build index 2cb66a5..6d4d6a2 100644 --- a/Dockerfile.16-bullseye-build +++ b/Dockerfile.16-bullseye-build @@ -1,4 +1,4 @@ -# DO NOT EDIT THIS FILE : Make yours changes in /utils/Dockerfile.blueprint) +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) FROM debian:bullseye-slim LABEL authors="Julien Neuhart , David Négrier " @@ -34,7 +34,7 @@ RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0. # | Define a default user with sudo rights. # | - RUN useradd -ms /bin/bash docker && adduser docker sudo + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker # Users in the sudoers group can sudo as root without password. RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers diff --git a/Dockerfile.18-apache-bullseye b/Dockerfile.18-apache-bullseye index a3f96c5..db84c96 100644 --- a/Dockerfile.18-apache-bullseye +++ b/Dockerfile.18-apache-bullseye @@ -1,4 +1,4 @@ -# DO NOT EDIT THIS FILE : Make yours changes in /utils/Dockerfile.blueprint) +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) FROM debian:bullseye-slim LABEL authors="Julien Neuhart , David Négrier " @@ -34,7 +34,7 @@ RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0. # | Define a default user with sudo rights. # | - RUN useradd -ms /bin/bash docker && adduser docker sudo + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker # Users in the sudoers group can sudo as root without password. RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers diff --git a/Dockerfile.18-apache-bullseye-build b/Dockerfile.18-apache-bullseye-build index 1c8292e..de0c440 100644 --- a/Dockerfile.18-apache-bullseye-build +++ b/Dockerfile.18-apache-bullseye-build @@ -1,4 +1,4 @@ -# DO NOT EDIT THIS FILE : Make yours changes in /utils/Dockerfile.blueprint) +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) FROM debian:bullseye-slim LABEL authors="Julien Neuhart , David Négrier " @@ -34,7 +34,7 @@ RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0. # | Define a default user with sudo rights. # | - RUN useradd -ms /bin/bash docker && adduser docker sudo + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker # Users in the sudoers group can sudo as root without password. RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers diff --git a/Dockerfile.18-bullseye b/Dockerfile.18-bullseye index cc1ebf6..e5cbee9 100644 --- a/Dockerfile.18-bullseye +++ b/Dockerfile.18-bullseye @@ -1,4 +1,4 @@ -# DO NOT EDIT THIS FILE : Make yours changes in /utils/Dockerfile.blueprint) +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) FROM debian:bullseye-slim LABEL authors="Julien Neuhart , David Négrier " @@ -34,7 +34,7 @@ RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0. # | Define a default user with sudo rights. # | - RUN useradd -ms /bin/bash docker && adduser docker sudo + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker # Users in the sudoers group can sudo as root without password. RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers diff --git a/Dockerfile.18-bullseye-build b/Dockerfile.18-bullseye-build index d2ace69..ef930ab 100644 --- a/Dockerfile.18-bullseye-build +++ b/Dockerfile.18-bullseye-build @@ -1,4 +1,4 @@ -# DO NOT EDIT THIS FILE : Make yours changes in /utils/Dockerfile.blueprint) +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) FROM debian:bullseye-slim LABEL authors="Julien Neuhart , David Négrier " @@ -34,7 +34,7 @@ RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0. # | Define a default user with sudo rights. # | - RUN useradd -ms /bin/bash docker && adduser docker sudo + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker # Users in the sudoers group can sudo as root without password. RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers diff --git a/Dockerfile.20-apache-bullseye b/Dockerfile.20-apache-bullseye index 758244c..ae93461 100644 --- a/Dockerfile.20-apache-bullseye +++ b/Dockerfile.20-apache-bullseye @@ -1,4 +1,4 @@ -# DO NOT EDIT THIS FILE : Make yours changes in /utils/Dockerfile.blueprint) +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) FROM debian:bullseye-slim LABEL authors="Julien Neuhart , David Négrier " @@ -34,7 +34,7 @@ RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0. # | Define a default user with sudo rights. # | - RUN useradd -ms /bin/bash docker && adduser docker sudo + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker # Users in the sudoers group can sudo as root without password. RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers diff --git a/Dockerfile.20-apache-bullseye-build b/Dockerfile.20-apache-bullseye-build index 5c4c11a..16e97bc 100644 --- a/Dockerfile.20-apache-bullseye-build +++ b/Dockerfile.20-apache-bullseye-build @@ -1,4 +1,4 @@ -# DO NOT EDIT THIS FILE : Make yours changes in /utils/Dockerfile.blueprint) +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) FROM debian:bullseye-slim LABEL authors="Julien Neuhart , David Négrier " @@ -34,7 +34,7 @@ RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0. # | Define a default user with sudo rights. # | - RUN useradd -ms /bin/bash docker && adduser docker sudo + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker # Users in the sudoers group can sudo as root without password. RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers diff --git a/Dockerfile.20-apache-trixie b/Dockerfile.20-apache-trixie new file mode 100644 index 0000000..515c25e --- /dev/null +++ b/Dockerfile.20-apache-trixie @@ -0,0 +1,225 @@ +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) +FROM debian:trixie-slim + +LABEL authors="Julien Neuhart , David Négrier " + +# |-------------------------------------------------------------------------- +# | Required libraries +# |-------------------------------------------------------------------------- +# | +# | Installs required libraries. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends curl git nano sudo ca-certificates procps libfontconfig tini --no-install-recommends + +# |-------------------------------------------------------------------------- +# | Supercronic +# |-------------------------------------------------------------------------- +# | +# | Supercronic is a drop-in replacement for cron (for containers). +# | + +RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.12/supercronic-linux-$( dpkg --print-architecture ) \ + && SUPERCRONIC=supercronic-linux-$( dpkg --print-architecture ) \ + && curl -fsSLO "$SUPERCRONIC_URL" \ + && chmod +x "$SUPERCRONIC" \ + && mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \ + && ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic + + # |-------------------------------------------------------------------------- + # | User + # |-------------------------------------------------------------------------- + # | + # | Define a default user with sudo rights. + # | + + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker + # Users in the sudoers group can sudo as root without password. + RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + + + +# |-------------------------------------------------------------------------- +# | Apache +# |-------------------------------------------------------------------------- +# | +# | Installs Apache. +# | + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + apache2 \ + && rm -rf /var/lib/apt/lists/* + +ENV APACHE_CONFDIR /etc/apache2 +ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars + +RUN set -ex \ + \ +# generically convert lines like +# export APACHE_RUN_USER=www-data +# into +# : ${APACHE_RUN_USER:=www-data} +# export APACHE_RUN_USER +# so that they can be overridden at runtime ("-e APACHE_RUN_USER=...") + && sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS" \ + \ +# setup directories and permissions + && . "$APACHE_ENVVARS" \ + && for dir in \ + "$APACHE_LOCK_DIR" \ + "$APACHE_RUN_DIR" \ + "$APACHE_LOG_DIR" \ + /var/www/html \ + ; do \ + rm -rvf "$dir" \ + && mkdir -p "$dir" \ + && chown -R "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir"; \ + done + +# logs should go to stdout / stderr +RUN set -ex \ + && . "$APACHE_ENVVARS" \ + && ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log" \ + && ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log" \ + && ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log" + +ENV APACHE_DOCUMENT_ROOT / + +RUN { \ + echo 'DirectoryIndex disabled'; \ + echo 'DirectoryIndex index.html'; \ + echo; \ + echo ''; \ + echo '\tOptions -Indexes'; \ + echo '\tAllowOverride All'; \ + echo ''; \ + } | tee "$APACHE_CONFDIR/conf-available/nodejs.conf" \ + && a2enconf nodejs + +RUN sed -ri -e 's!/var/www/html!/var/www/html/${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf +RUN sed -ri -e 's!/var/www/!/var/www/html/${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf + +# |-------------------------------------------------------------------------- +# | Apache mod_rewrite +# |-------------------------------------------------------------------------- +# | +# | Enables Apache mod_rewrite. +# | + +RUN a2enmod rewrite + + +# |-------------------------------------------------------------------------- +# | NodeJS +# |-------------------------------------------------------------------------- +# | +# | Installs NodeJS and npm. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends gnupg &&\ + mkdir -p /etc/apt/keyrings && \ + curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ + echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list &&\ + apt-get update &&\ + apt-get install -y --no-install-recommends nodejs + +# |-------------------------------------------------------------------------- +# | yarn +# |-------------------------------------------------------------------------- +# | +# | Installs yarn. It provides some nice improvements over npm. +# | + +RUN corepack enable && corepack prepare yarn@stable --activate + +# |-------------------------------------------------------------------------- +# | PATH updating +# |-------------------------------------------------------------------------- +# | +# | Let's add ./node_modules/.bin to the PATH (utility function to use NPM bin easily) +# | + +ENV PATH="$PATH:./node_modules/.bin" +RUN sed -i 's#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:./node_modules/.bin#g' /etc/sudoers + +USER docker +# |-------------------------------------------------------------------------- +# | SSH client +# |-------------------------------------------------------------------------- +# | +# | Let's set-up the SSH client (for connections to private git repositories) +# | We create an empty known_host file and we launch the ssh-agent +# | + +RUN mkdir ~/.ssh && touch ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts && eval $(ssh-agent -s) + +# |-------------------------------------------------------------------------- +# | .bashrc updating +# |-------------------------------------------------------------------------- +# | +# | Let's update the .bashrc to add nice aliases +# | +RUN { \ + echo "alias ls='ls --color=auto'"; \ + echo "alias ll='ls --color=auto -alF'"; \ + echo "alias la='ls --color=auto -A'"; \ + echo "alias l='ls --color=auto -CF'"; \ + } >> ~/.bashrc + +USER root + +# |-------------------------------------------------------------------------- +# | Entrypoint +# |-------------------------------------------------------------------------- +# | +# | Defines the entrypoint. +# | + +ENV NODE_VERSION=20.x + + +RUN mkdir -p /var/www/html && chown docker:docker /var/www/html +WORKDIR /var/www/html + + +COPY utils/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh +COPY utils/docker-entrypoint-as-root.sh /usr/local/bin/docker-entrypoint-as-root.sh +COPY utils/startup_commands.js /usr/local/bin/startup_commands.js +COPY utils/generate_cron.js /usr/local/bin/generate_cron.js + + + +COPY utils/enable_apache_mods.js /usr/local/bin/enable_apache_mods.js +COPY utils/apache-expose-envvars.sh /usr/local/bin/apache-expose-envvars.sh + +# Let's register a servername to remove the message "apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message" +RUN echo "ServerName localhost" > /etc/apache2/conf-available/servername.conf +RUN a2enconf servername + +EXPOSE 80 + +# |-------------------------------------------------------------------------- +# | Apache user +# |-------------------------------------------------------------------------- +# | +# | Defines Apache user. By default, we switch this to "docker" user. +# | This way, no problem to write from Apache in the current working directory. +# | Important! This should be changed back to www-data in production. +# | + +ENV APACHE_RUN_USER=docker \ + APACHE_RUN_GROUP=docker + +COPY utils/apache2-foreground /usr/local/bin/ +CMD ["apache2-foreground"] + + + + +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] + + +USER docker diff --git a/Dockerfile.20-apache-trixie-build b/Dockerfile.20-apache-trixie-build new file mode 100644 index 0000000..b21ab03 --- /dev/null +++ b/Dockerfile.20-apache-trixie-build @@ -0,0 +1,229 @@ +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) +FROM debian:trixie-slim + +LABEL authors="Julien Neuhart , David Négrier " + +# |-------------------------------------------------------------------------- +# | Required libraries +# |-------------------------------------------------------------------------- +# | +# | Installs required libraries. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends curl git nano sudo ca-certificates procps libfontconfig tini --no-install-recommends + +# |-------------------------------------------------------------------------- +# | Supercronic +# |-------------------------------------------------------------------------- +# | +# | Supercronic is a drop-in replacement for cron (for containers). +# | + +RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.12/supercronic-linux-$( dpkg --print-architecture ) \ + && SUPERCRONIC=supercronic-linux-$( dpkg --print-architecture ) \ + && curl -fsSLO "$SUPERCRONIC_URL" \ + && chmod +x "$SUPERCRONIC" \ + && mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \ + && ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic + + # |-------------------------------------------------------------------------- + # | User + # |-------------------------------------------------------------------------- + # | + # | Define a default user with sudo rights. + # | + + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker + # Users in the sudoers group can sudo as root without password. + RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + + + +# |-------------------------------------------------------------------------- +# | Apache +# |-------------------------------------------------------------------------- +# | +# | Installs Apache. +# | + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + apache2 \ + && rm -rf /var/lib/apt/lists/* + +ENV APACHE_CONFDIR /etc/apache2 +ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars + +RUN set -ex \ + \ +# generically convert lines like +# export APACHE_RUN_USER=www-data +# into +# : ${APACHE_RUN_USER:=www-data} +# export APACHE_RUN_USER +# so that they can be overridden at runtime ("-e APACHE_RUN_USER=...") + && sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS" \ + \ +# setup directories and permissions + && . "$APACHE_ENVVARS" \ + && for dir in \ + "$APACHE_LOCK_DIR" \ + "$APACHE_RUN_DIR" \ + "$APACHE_LOG_DIR" \ + /var/www/html \ + ; do \ + rm -rvf "$dir" \ + && mkdir -p "$dir" \ + && chown -R "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir"; \ + done + +# logs should go to stdout / stderr +RUN set -ex \ + && . "$APACHE_ENVVARS" \ + && ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log" \ + && ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log" \ + && ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log" + +ENV APACHE_DOCUMENT_ROOT / + +RUN { \ + echo 'DirectoryIndex disabled'; \ + echo 'DirectoryIndex index.html'; \ + echo; \ + echo ''; \ + echo '\tOptions -Indexes'; \ + echo '\tAllowOverride All'; \ + echo ''; \ + } | tee "$APACHE_CONFDIR/conf-available/nodejs.conf" \ + && a2enconf nodejs + +RUN sed -ri -e 's!/var/www/html!/var/www/html/${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf +RUN sed -ri -e 's!/var/www/!/var/www/html/${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf + +# |-------------------------------------------------------------------------- +# | Apache mod_rewrite +# |-------------------------------------------------------------------------- +# | +# | Enables Apache mod_rewrite. +# | + +RUN a2enmod rewrite + + +# |-------------------------------------------------------------------------- +# | NodeJS +# |-------------------------------------------------------------------------- +# | +# | Installs NodeJS and npm. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends gnupg &&\ + mkdir -p /etc/apt/keyrings && \ + curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ + echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list &&\ + apt-get update &&\ + apt-get install -y --no-install-recommends nodejs + +# |-------------------------------------------------------------------------- +# | yarn +# |-------------------------------------------------------------------------- +# | +# | Installs yarn. It provides some nice improvements over npm. +# | + +RUN corepack enable && corepack prepare yarn@stable --activate + +# |-------------------------------------------------------------------------- +# | PATH updating +# |-------------------------------------------------------------------------- +# | +# | Let's add ./node_modules/.bin to the PATH (utility function to use NPM bin easily) +# | + +ENV PATH="$PATH:./node_modules/.bin" +RUN sed -i 's#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:./node_modules/.bin#g' /etc/sudoers + +USER docker +# |-------------------------------------------------------------------------- +# | SSH client +# |-------------------------------------------------------------------------- +# | +# | Let's set-up the SSH client (for connections to private git repositories) +# | We create an empty known_host file and we launch the ssh-agent +# | + +RUN mkdir ~/.ssh && touch ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts && eval $(ssh-agent -s) + +# |-------------------------------------------------------------------------- +# | .bashrc updating +# |-------------------------------------------------------------------------- +# | +# | Let's update the .bashrc to add nice aliases +# | +RUN { \ + echo "alias ls='ls --color=auto'"; \ + echo "alias ll='ls --color=auto -alF'"; \ + echo "alias la='ls --color=auto -A'"; \ + echo "alias l='ls --color=auto -CF'"; \ + } >> ~/.bashrc + +USER root + +# |-------------------------------------------------------------------------- +# | Entrypoint +# |-------------------------------------------------------------------------- +# | +# | Defines the entrypoint. +# | + +ENV NODE_VERSION=20.x + + +RUN mkdir -p /var/www/html && chown docker:docker /var/www/html +WORKDIR /var/www/html + + +COPY utils/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh +COPY utils/docker-entrypoint-as-root.sh /usr/local/bin/docker-entrypoint-as-root.sh +COPY utils/startup_commands.js /usr/local/bin/startup_commands.js +COPY utils/generate_cron.js /usr/local/bin/generate_cron.js + + + +COPY utils/enable_apache_mods.js /usr/local/bin/enable_apache_mods.js +COPY utils/apache-expose-envvars.sh /usr/local/bin/apache-expose-envvars.sh + +# Let's register a servername to remove the message "apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message" +RUN echo "ServerName localhost" > /etc/apache2/conf-available/servername.conf +RUN a2enconf servername + +EXPOSE 80 + +# |-------------------------------------------------------------------------- +# | Apache user +# |-------------------------------------------------------------------------- +# | +# | Defines Apache user. By default, we switch this to "docker" user. +# | This way, no problem to write from Apache in the current working directory. +# | Important! This should be changed back to www-data in production. +# | + +ENV APACHE_RUN_USER=docker \ + APACHE_RUN_GROUP=docker + +COPY utils/apache2-foreground /usr/local/bin/ +CMD ["apache2-foreground"] + + + +# Let's install the build tools (useful for node-gyp) +RUN apt-get update &&\ + apt-get install -y --no-install-recommends build-essential + + +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] + + +USER docker diff --git a/Dockerfile.20-bullseye b/Dockerfile.20-bullseye index 402e863..4afa54b 100644 --- a/Dockerfile.20-bullseye +++ b/Dockerfile.20-bullseye @@ -1,4 +1,4 @@ -# DO NOT EDIT THIS FILE : Make yours changes in /utils/Dockerfile.blueprint) +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) FROM debian:bullseye-slim LABEL authors="Julien Neuhart , David Négrier " @@ -34,7 +34,7 @@ RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0. # | Define a default user with sudo rights. # | - RUN useradd -ms /bin/bash docker && adduser docker sudo + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker # Users in the sudoers group can sudo as root without password. RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers diff --git a/Dockerfile.20-bullseye-build b/Dockerfile.20-bullseye-build index e45d6f2..a408455 100644 --- a/Dockerfile.20-bullseye-build +++ b/Dockerfile.20-bullseye-build @@ -1,4 +1,4 @@ -# DO NOT EDIT THIS FILE : Make yours changes in /utils/Dockerfile.blueprint) +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) FROM debian:bullseye-slim LABEL authors="Julien Neuhart , David Négrier " @@ -34,7 +34,7 @@ RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0. # | Define a default user with sudo rights. # | - RUN useradd -ms /bin/bash docker && adduser docker sudo + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker # Users in the sudoers group can sudo as root without password. RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers diff --git a/Dockerfile.20-trixie b/Dockerfile.20-trixie new file mode 100644 index 0000000..38ab6eb --- /dev/null +++ b/Dockerfile.20-trixie @@ -0,0 +1,133 @@ +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) +FROM debian:trixie-slim + +LABEL authors="Julien Neuhart , David Négrier " + +# |-------------------------------------------------------------------------- +# | Required libraries +# |-------------------------------------------------------------------------- +# | +# | Installs required libraries. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends curl git nano sudo ca-certificates procps libfontconfig tini --no-install-recommends + +# |-------------------------------------------------------------------------- +# | Supercronic +# |-------------------------------------------------------------------------- +# | +# | Supercronic is a drop-in replacement for cron (for containers). +# | + +RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.12/supercronic-linux-$( dpkg --print-architecture ) \ + && SUPERCRONIC=supercronic-linux-$( dpkg --print-architecture ) \ + && curl -fsSLO "$SUPERCRONIC_URL" \ + && chmod +x "$SUPERCRONIC" \ + && mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \ + && ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic + + # |-------------------------------------------------------------------------- + # | User + # |-------------------------------------------------------------------------- + # | + # | Define a default user with sudo rights. + # | + + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker + # Users in the sudoers group can sudo as root without password. + RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + + + + +# |-------------------------------------------------------------------------- +# | NodeJS +# |-------------------------------------------------------------------------- +# | +# | Installs NodeJS and npm. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends gnupg &&\ + mkdir -p /etc/apt/keyrings && \ + curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ + echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list &&\ + apt-get update &&\ + apt-get install -y --no-install-recommends nodejs + +# |-------------------------------------------------------------------------- +# | yarn +# |-------------------------------------------------------------------------- +# | +# | Installs yarn. It provides some nice improvements over npm. +# | + +RUN corepack enable && corepack prepare yarn@stable --activate + +# |-------------------------------------------------------------------------- +# | PATH updating +# |-------------------------------------------------------------------------- +# | +# | Let's add ./node_modules/.bin to the PATH (utility function to use NPM bin easily) +# | + +ENV PATH="$PATH:./node_modules/.bin" +RUN sed -i 's#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:./node_modules/.bin#g' /etc/sudoers + +USER docker +# |-------------------------------------------------------------------------- +# | SSH client +# |-------------------------------------------------------------------------- +# | +# | Let's set-up the SSH client (for connections to private git repositories) +# | We create an empty known_host file and we launch the ssh-agent +# | + +RUN mkdir ~/.ssh && touch ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts && eval $(ssh-agent -s) + +# |-------------------------------------------------------------------------- +# | .bashrc updating +# |-------------------------------------------------------------------------- +# | +# | Let's update the .bashrc to add nice aliases +# | +RUN { \ + echo "alias ls='ls --color=auto'"; \ + echo "alias ll='ls --color=auto -alF'"; \ + echo "alias la='ls --color=auto -A'"; \ + echo "alias l='ls --color=auto -CF'"; \ + } >> ~/.bashrc + +USER root + +# |-------------------------------------------------------------------------- +# | Entrypoint +# |-------------------------------------------------------------------------- +# | +# | Defines the entrypoint. +# | + +ENV NODE_VERSION=20.x + + +RUN mkdir -p /usr/src/app && chown docker:docker /usr/src/app +WORKDIR /usr/src/app + + +COPY utils/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh +COPY utils/docker-entrypoint-as-root.sh /usr/local/bin/docker-entrypoint-as-root.sh +COPY utils/startup_commands.js /usr/local/bin/startup_commands.js +COPY utils/generate_cron.js /usr/local/bin/generate_cron.js + + + +CMD [ "node" ] + + + + +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] + + +USER docker diff --git a/Dockerfile.20-trixie-build b/Dockerfile.20-trixie-build new file mode 100644 index 0000000..b8e7eb4 --- /dev/null +++ b/Dockerfile.20-trixie-build @@ -0,0 +1,137 @@ +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) +FROM debian:trixie-slim + +LABEL authors="Julien Neuhart , David Négrier " + +# |-------------------------------------------------------------------------- +# | Required libraries +# |-------------------------------------------------------------------------- +# | +# | Installs required libraries. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends curl git nano sudo ca-certificates procps libfontconfig tini --no-install-recommends + +# |-------------------------------------------------------------------------- +# | Supercronic +# |-------------------------------------------------------------------------- +# | +# | Supercronic is a drop-in replacement for cron (for containers). +# | + +RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.12/supercronic-linux-$( dpkg --print-architecture ) \ + && SUPERCRONIC=supercronic-linux-$( dpkg --print-architecture ) \ + && curl -fsSLO "$SUPERCRONIC_URL" \ + && chmod +x "$SUPERCRONIC" \ + && mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \ + && ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic + + # |-------------------------------------------------------------------------- + # | User + # |-------------------------------------------------------------------------- + # | + # | Define a default user with sudo rights. + # | + + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker + # Users in the sudoers group can sudo as root without password. + RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + + + + +# |-------------------------------------------------------------------------- +# | NodeJS +# |-------------------------------------------------------------------------- +# | +# | Installs NodeJS and npm. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends gnupg &&\ + mkdir -p /etc/apt/keyrings && \ + curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ + echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list &&\ + apt-get update &&\ + apt-get install -y --no-install-recommends nodejs + +# |-------------------------------------------------------------------------- +# | yarn +# |-------------------------------------------------------------------------- +# | +# | Installs yarn. It provides some nice improvements over npm. +# | + +RUN corepack enable && corepack prepare yarn@stable --activate + +# |-------------------------------------------------------------------------- +# | PATH updating +# |-------------------------------------------------------------------------- +# | +# | Let's add ./node_modules/.bin to the PATH (utility function to use NPM bin easily) +# | + +ENV PATH="$PATH:./node_modules/.bin" +RUN sed -i 's#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:./node_modules/.bin#g' /etc/sudoers + +USER docker +# |-------------------------------------------------------------------------- +# | SSH client +# |-------------------------------------------------------------------------- +# | +# | Let's set-up the SSH client (for connections to private git repositories) +# | We create an empty known_host file and we launch the ssh-agent +# | + +RUN mkdir ~/.ssh && touch ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts && eval $(ssh-agent -s) + +# |-------------------------------------------------------------------------- +# | .bashrc updating +# |-------------------------------------------------------------------------- +# | +# | Let's update the .bashrc to add nice aliases +# | +RUN { \ + echo "alias ls='ls --color=auto'"; \ + echo "alias ll='ls --color=auto -alF'"; \ + echo "alias la='ls --color=auto -A'"; \ + echo "alias l='ls --color=auto -CF'"; \ + } >> ~/.bashrc + +USER root + +# |-------------------------------------------------------------------------- +# | Entrypoint +# |-------------------------------------------------------------------------- +# | +# | Defines the entrypoint. +# | + +ENV NODE_VERSION=20.x + + +RUN mkdir -p /usr/src/app && chown docker:docker /usr/src/app +WORKDIR /usr/src/app + + +COPY utils/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh +COPY utils/docker-entrypoint-as-root.sh /usr/local/bin/docker-entrypoint-as-root.sh +COPY utils/startup_commands.js /usr/local/bin/startup_commands.js +COPY utils/generate_cron.js /usr/local/bin/generate_cron.js + + + +CMD [ "node" ] + + + +# Let's install the build tools (useful for node-gyp) +RUN apt-get update &&\ + apt-get install -y --no-install-recommends build-essential + + +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] + + +USER docker diff --git a/Dockerfile.22-apache-bullseye b/Dockerfile.22-apache-bullseye index ba34f56..f2ef0de 100644 --- a/Dockerfile.22-apache-bullseye +++ b/Dockerfile.22-apache-bullseye @@ -1,4 +1,4 @@ -# DO NOT EDIT THIS FILE : Make yours changes in /utils/Dockerfile.blueprint) +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) FROM debian:bullseye-slim LABEL authors="Julien Neuhart , David Négrier " @@ -34,7 +34,7 @@ RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0. # | Define a default user with sudo rights. # | - RUN useradd -ms /bin/bash docker && adduser docker sudo + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker # Users in the sudoers group can sudo as root without password. RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers diff --git a/Dockerfile.22-apache-bullseye-build b/Dockerfile.22-apache-bullseye-build index 839aa27..b9c04ae 100644 --- a/Dockerfile.22-apache-bullseye-build +++ b/Dockerfile.22-apache-bullseye-build @@ -1,4 +1,4 @@ -# DO NOT EDIT THIS FILE : Make yours changes in /utils/Dockerfile.blueprint) +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) FROM debian:bullseye-slim LABEL authors="Julien Neuhart , David Négrier " @@ -34,7 +34,7 @@ RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0. # | Define a default user with sudo rights. # | - RUN useradd -ms /bin/bash docker && adduser docker sudo + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker # Users in the sudoers group can sudo as root without password. RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers diff --git a/Dockerfile.22-apache-trixie b/Dockerfile.22-apache-trixie new file mode 100644 index 0000000..c945160 --- /dev/null +++ b/Dockerfile.22-apache-trixie @@ -0,0 +1,225 @@ +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) +FROM debian:trixie-slim + +LABEL authors="Julien Neuhart , David Négrier " + +# |-------------------------------------------------------------------------- +# | Required libraries +# |-------------------------------------------------------------------------- +# | +# | Installs required libraries. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends curl git nano sudo ca-certificates procps libfontconfig tini --no-install-recommends + +# |-------------------------------------------------------------------------- +# | Supercronic +# |-------------------------------------------------------------------------- +# | +# | Supercronic is a drop-in replacement for cron (for containers). +# | + +RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.12/supercronic-linux-$( dpkg --print-architecture ) \ + && SUPERCRONIC=supercronic-linux-$( dpkg --print-architecture ) \ + && curl -fsSLO "$SUPERCRONIC_URL" \ + && chmod +x "$SUPERCRONIC" \ + && mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \ + && ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic + + # |-------------------------------------------------------------------------- + # | User + # |-------------------------------------------------------------------------- + # | + # | Define a default user with sudo rights. + # | + + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker + # Users in the sudoers group can sudo as root without password. + RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + + + +# |-------------------------------------------------------------------------- +# | Apache +# |-------------------------------------------------------------------------- +# | +# | Installs Apache. +# | + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + apache2 \ + && rm -rf /var/lib/apt/lists/* + +ENV APACHE_CONFDIR /etc/apache2 +ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars + +RUN set -ex \ + \ +# generically convert lines like +# export APACHE_RUN_USER=www-data +# into +# : ${APACHE_RUN_USER:=www-data} +# export APACHE_RUN_USER +# so that they can be overridden at runtime ("-e APACHE_RUN_USER=...") + && sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS" \ + \ +# setup directories and permissions + && . "$APACHE_ENVVARS" \ + && for dir in \ + "$APACHE_LOCK_DIR" \ + "$APACHE_RUN_DIR" \ + "$APACHE_LOG_DIR" \ + /var/www/html \ + ; do \ + rm -rvf "$dir" \ + && mkdir -p "$dir" \ + && chown -R "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir"; \ + done + +# logs should go to stdout / stderr +RUN set -ex \ + && . "$APACHE_ENVVARS" \ + && ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log" \ + && ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log" \ + && ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log" + +ENV APACHE_DOCUMENT_ROOT / + +RUN { \ + echo 'DirectoryIndex disabled'; \ + echo 'DirectoryIndex index.html'; \ + echo; \ + echo ''; \ + echo '\tOptions -Indexes'; \ + echo '\tAllowOverride All'; \ + echo ''; \ + } | tee "$APACHE_CONFDIR/conf-available/nodejs.conf" \ + && a2enconf nodejs + +RUN sed -ri -e 's!/var/www/html!/var/www/html/${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf +RUN sed -ri -e 's!/var/www/!/var/www/html/${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf + +# |-------------------------------------------------------------------------- +# | Apache mod_rewrite +# |-------------------------------------------------------------------------- +# | +# | Enables Apache mod_rewrite. +# | + +RUN a2enmod rewrite + + +# |-------------------------------------------------------------------------- +# | NodeJS +# |-------------------------------------------------------------------------- +# | +# | Installs NodeJS and npm. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends gnupg &&\ + mkdir -p /etc/apt/keyrings && \ + curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ + echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list &&\ + apt-get update &&\ + apt-get install -y --no-install-recommends nodejs + +# |-------------------------------------------------------------------------- +# | yarn +# |-------------------------------------------------------------------------- +# | +# | Installs yarn. It provides some nice improvements over npm. +# | + +RUN corepack enable && corepack prepare yarn@stable --activate + +# |-------------------------------------------------------------------------- +# | PATH updating +# |-------------------------------------------------------------------------- +# | +# | Let's add ./node_modules/.bin to the PATH (utility function to use NPM bin easily) +# | + +ENV PATH="$PATH:./node_modules/.bin" +RUN sed -i 's#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:./node_modules/.bin#g' /etc/sudoers + +USER docker +# |-------------------------------------------------------------------------- +# | SSH client +# |-------------------------------------------------------------------------- +# | +# | Let's set-up the SSH client (for connections to private git repositories) +# | We create an empty known_host file and we launch the ssh-agent +# | + +RUN mkdir ~/.ssh && touch ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts && eval $(ssh-agent -s) + +# |-------------------------------------------------------------------------- +# | .bashrc updating +# |-------------------------------------------------------------------------- +# | +# | Let's update the .bashrc to add nice aliases +# | +RUN { \ + echo "alias ls='ls --color=auto'"; \ + echo "alias ll='ls --color=auto -alF'"; \ + echo "alias la='ls --color=auto -A'"; \ + echo "alias l='ls --color=auto -CF'"; \ + } >> ~/.bashrc + +USER root + +# |-------------------------------------------------------------------------- +# | Entrypoint +# |-------------------------------------------------------------------------- +# | +# | Defines the entrypoint. +# | + +ENV NODE_VERSION=22.x + + +RUN mkdir -p /var/www/html && chown docker:docker /var/www/html +WORKDIR /var/www/html + + +COPY utils/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh +COPY utils/docker-entrypoint-as-root.sh /usr/local/bin/docker-entrypoint-as-root.sh +COPY utils/startup_commands.js /usr/local/bin/startup_commands.js +COPY utils/generate_cron.js /usr/local/bin/generate_cron.js + + + +COPY utils/enable_apache_mods.js /usr/local/bin/enable_apache_mods.js +COPY utils/apache-expose-envvars.sh /usr/local/bin/apache-expose-envvars.sh + +# Let's register a servername to remove the message "apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message" +RUN echo "ServerName localhost" > /etc/apache2/conf-available/servername.conf +RUN a2enconf servername + +EXPOSE 80 + +# |-------------------------------------------------------------------------- +# | Apache user +# |-------------------------------------------------------------------------- +# | +# | Defines Apache user. By default, we switch this to "docker" user. +# | This way, no problem to write from Apache in the current working directory. +# | Important! This should be changed back to www-data in production. +# | + +ENV APACHE_RUN_USER=docker \ + APACHE_RUN_GROUP=docker + +COPY utils/apache2-foreground /usr/local/bin/ +CMD ["apache2-foreground"] + + + + +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] + + +USER docker diff --git a/Dockerfile.22-apache-trixie-build b/Dockerfile.22-apache-trixie-build new file mode 100644 index 0000000..2defab6 --- /dev/null +++ b/Dockerfile.22-apache-trixie-build @@ -0,0 +1,229 @@ +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) +FROM debian:trixie-slim + +LABEL authors="Julien Neuhart , David Négrier " + +# |-------------------------------------------------------------------------- +# | Required libraries +# |-------------------------------------------------------------------------- +# | +# | Installs required libraries. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends curl git nano sudo ca-certificates procps libfontconfig tini --no-install-recommends + +# |-------------------------------------------------------------------------- +# | Supercronic +# |-------------------------------------------------------------------------- +# | +# | Supercronic is a drop-in replacement for cron (for containers). +# | + +RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.12/supercronic-linux-$( dpkg --print-architecture ) \ + && SUPERCRONIC=supercronic-linux-$( dpkg --print-architecture ) \ + && curl -fsSLO "$SUPERCRONIC_URL" \ + && chmod +x "$SUPERCRONIC" \ + && mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \ + && ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic + + # |-------------------------------------------------------------------------- + # | User + # |-------------------------------------------------------------------------- + # | + # | Define a default user with sudo rights. + # | + + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker + # Users in the sudoers group can sudo as root without password. + RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + + + +# |-------------------------------------------------------------------------- +# | Apache +# |-------------------------------------------------------------------------- +# | +# | Installs Apache. +# | + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + apache2 \ + && rm -rf /var/lib/apt/lists/* + +ENV APACHE_CONFDIR /etc/apache2 +ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars + +RUN set -ex \ + \ +# generically convert lines like +# export APACHE_RUN_USER=www-data +# into +# : ${APACHE_RUN_USER:=www-data} +# export APACHE_RUN_USER +# so that they can be overridden at runtime ("-e APACHE_RUN_USER=...") + && sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS" \ + \ +# setup directories and permissions + && . "$APACHE_ENVVARS" \ + && for dir in \ + "$APACHE_LOCK_DIR" \ + "$APACHE_RUN_DIR" \ + "$APACHE_LOG_DIR" \ + /var/www/html \ + ; do \ + rm -rvf "$dir" \ + && mkdir -p "$dir" \ + && chown -R "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir"; \ + done + +# logs should go to stdout / stderr +RUN set -ex \ + && . "$APACHE_ENVVARS" \ + && ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log" \ + && ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log" \ + && ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log" + +ENV APACHE_DOCUMENT_ROOT / + +RUN { \ + echo 'DirectoryIndex disabled'; \ + echo 'DirectoryIndex index.html'; \ + echo; \ + echo ''; \ + echo '\tOptions -Indexes'; \ + echo '\tAllowOverride All'; \ + echo ''; \ + } | tee "$APACHE_CONFDIR/conf-available/nodejs.conf" \ + && a2enconf nodejs + +RUN sed -ri -e 's!/var/www/html!/var/www/html/${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf +RUN sed -ri -e 's!/var/www/!/var/www/html/${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf + +# |-------------------------------------------------------------------------- +# | Apache mod_rewrite +# |-------------------------------------------------------------------------- +# | +# | Enables Apache mod_rewrite. +# | + +RUN a2enmod rewrite + + +# |-------------------------------------------------------------------------- +# | NodeJS +# |-------------------------------------------------------------------------- +# | +# | Installs NodeJS and npm. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends gnupg &&\ + mkdir -p /etc/apt/keyrings && \ + curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ + echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list &&\ + apt-get update &&\ + apt-get install -y --no-install-recommends nodejs + +# |-------------------------------------------------------------------------- +# | yarn +# |-------------------------------------------------------------------------- +# | +# | Installs yarn. It provides some nice improvements over npm. +# | + +RUN corepack enable && corepack prepare yarn@stable --activate + +# |-------------------------------------------------------------------------- +# | PATH updating +# |-------------------------------------------------------------------------- +# | +# | Let's add ./node_modules/.bin to the PATH (utility function to use NPM bin easily) +# | + +ENV PATH="$PATH:./node_modules/.bin" +RUN sed -i 's#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:./node_modules/.bin#g' /etc/sudoers + +USER docker +# |-------------------------------------------------------------------------- +# | SSH client +# |-------------------------------------------------------------------------- +# | +# | Let's set-up the SSH client (for connections to private git repositories) +# | We create an empty known_host file and we launch the ssh-agent +# | + +RUN mkdir ~/.ssh && touch ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts && eval $(ssh-agent -s) + +# |-------------------------------------------------------------------------- +# | .bashrc updating +# |-------------------------------------------------------------------------- +# | +# | Let's update the .bashrc to add nice aliases +# | +RUN { \ + echo "alias ls='ls --color=auto'"; \ + echo "alias ll='ls --color=auto -alF'"; \ + echo "alias la='ls --color=auto -A'"; \ + echo "alias l='ls --color=auto -CF'"; \ + } >> ~/.bashrc + +USER root + +# |-------------------------------------------------------------------------- +# | Entrypoint +# |-------------------------------------------------------------------------- +# | +# | Defines the entrypoint. +# | + +ENV NODE_VERSION=22.x + + +RUN mkdir -p /var/www/html && chown docker:docker /var/www/html +WORKDIR /var/www/html + + +COPY utils/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh +COPY utils/docker-entrypoint-as-root.sh /usr/local/bin/docker-entrypoint-as-root.sh +COPY utils/startup_commands.js /usr/local/bin/startup_commands.js +COPY utils/generate_cron.js /usr/local/bin/generate_cron.js + + + +COPY utils/enable_apache_mods.js /usr/local/bin/enable_apache_mods.js +COPY utils/apache-expose-envvars.sh /usr/local/bin/apache-expose-envvars.sh + +# Let's register a servername to remove the message "apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message" +RUN echo "ServerName localhost" > /etc/apache2/conf-available/servername.conf +RUN a2enconf servername + +EXPOSE 80 + +# |-------------------------------------------------------------------------- +# | Apache user +# |-------------------------------------------------------------------------- +# | +# | Defines Apache user. By default, we switch this to "docker" user. +# | This way, no problem to write from Apache in the current working directory. +# | Important! This should be changed back to www-data in production. +# | + +ENV APACHE_RUN_USER=docker \ + APACHE_RUN_GROUP=docker + +COPY utils/apache2-foreground /usr/local/bin/ +CMD ["apache2-foreground"] + + + +# Let's install the build tools (useful for node-gyp) +RUN apt-get update &&\ + apt-get install -y --no-install-recommends build-essential + + +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] + + +USER docker diff --git a/Dockerfile.22-bullseye b/Dockerfile.22-bullseye index fa3344c..89a53d0 100644 --- a/Dockerfile.22-bullseye +++ b/Dockerfile.22-bullseye @@ -1,4 +1,4 @@ -# DO NOT EDIT THIS FILE : Make yours changes in /utils/Dockerfile.blueprint) +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) FROM debian:bullseye-slim LABEL authors="Julien Neuhart , David Négrier " @@ -34,7 +34,7 @@ RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0. # | Define a default user with sudo rights. # | - RUN useradd -ms /bin/bash docker && adduser docker sudo + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker # Users in the sudoers group can sudo as root without password. RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers diff --git a/Dockerfile.22-bullseye-build b/Dockerfile.22-bullseye-build index 04a5de3..5d3d070 100644 --- a/Dockerfile.22-bullseye-build +++ b/Dockerfile.22-bullseye-build @@ -1,4 +1,4 @@ -# DO NOT EDIT THIS FILE : Make yours changes in /utils/Dockerfile.blueprint) +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) FROM debian:bullseye-slim LABEL authors="Julien Neuhart , David Négrier " @@ -34,7 +34,7 @@ RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0. # | Define a default user with sudo rights. # | - RUN useradd -ms /bin/bash docker && adduser docker sudo + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker # Users in the sudoers group can sudo as root without password. RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers diff --git a/Dockerfile.22-trixie b/Dockerfile.22-trixie new file mode 100644 index 0000000..d25c8be --- /dev/null +++ b/Dockerfile.22-trixie @@ -0,0 +1,133 @@ +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) +FROM debian:trixie-slim + +LABEL authors="Julien Neuhart , David Négrier " + +# |-------------------------------------------------------------------------- +# | Required libraries +# |-------------------------------------------------------------------------- +# | +# | Installs required libraries. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends curl git nano sudo ca-certificates procps libfontconfig tini --no-install-recommends + +# |-------------------------------------------------------------------------- +# | Supercronic +# |-------------------------------------------------------------------------- +# | +# | Supercronic is a drop-in replacement for cron (for containers). +# | + +RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.12/supercronic-linux-$( dpkg --print-architecture ) \ + && SUPERCRONIC=supercronic-linux-$( dpkg --print-architecture ) \ + && curl -fsSLO "$SUPERCRONIC_URL" \ + && chmod +x "$SUPERCRONIC" \ + && mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \ + && ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic + + # |-------------------------------------------------------------------------- + # | User + # |-------------------------------------------------------------------------- + # | + # | Define a default user with sudo rights. + # | + + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker + # Users in the sudoers group can sudo as root without password. + RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + + + + +# |-------------------------------------------------------------------------- +# | NodeJS +# |-------------------------------------------------------------------------- +# | +# | Installs NodeJS and npm. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends gnupg &&\ + mkdir -p /etc/apt/keyrings && \ + curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ + echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list &&\ + apt-get update &&\ + apt-get install -y --no-install-recommends nodejs + +# |-------------------------------------------------------------------------- +# | yarn +# |-------------------------------------------------------------------------- +# | +# | Installs yarn. It provides some nice improvements over npm. +# | + +RUN corepack enable && corepack prepare yarn@stable --activate + +# |-------------------------------------------------------------------------- +# | PATH updating +# |-------------------------------------------------------------------------- +# | +# | Let's add ./node_modules/.bin to the PATH (utility function to use NPM bin easily) +# | + +ENV PATH="$PATH:./node_modules/.bin" +RUN sed -i 's#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:./node_modules/.bin#g' /etc/sudoers + +USER docker +# |-------------------------------------------------------------------------- +# | SSH client +# |-------------------------------------------------------------------------- +# | +# | Let's set-up the SSH client (for connections to private git repositories) +# | We create an empty known_host file and we launch the ssh-agent +# | + +RUN mkdir ~/.ssh && touch ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts && eval $(ssh-agent -s) + +# |-------------------------------------------------------------------------- +# | .bashrc updating +# |-------------------------------------------------------------------------- +# | +# | Let's update the .bashrc to add nice aliases +# | +RUN { \ + echo "alias ls='ls --color=auto'"; \ + echo "alias ll='ls --color=auto -alF'"; \ + echo "alias la='ls --color=auto -A'"; \ + echo "alias l='ls --color=auto -CF'"; \ + } >> ~/.bashrc + +USER root + +# |-------------------------------------------------------------------------- +# | Entrypoint +# |-------------------------------------------------------------------------- +# | +# | Defines the entrypoint. +# | + +ENV NODE_VERSION=22.x + + +RUN mkdir -p /usr/src/app && chown docker:docker /usr/src/app +WORKDIR /usr/src/app + + +COPY utils/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh +COPY utils/docker-entrypoint-as-root.sh /usr/local/bin/docker-entrypoint-as-root.sh +COPY utils/startup_commands.js /usr/local/bin/startup_commands.js +COPY utils/generate_cron.js /usr/local/bin/generate_cron.js + + + +CMD [ "node" ] + + + + +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] + + +USER docker diff --git a/Dockerfile.22-trixie-build b/Dockerfile.22-trixie-build new file mode 100644 index 0000000..93454d0 --- /dev/null +++ b/Dockerfile.22-trixie-build @@ -0,0 +1,137 @@ +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) +FROM debian:trixie-slim + +LABEL authors="Julien Neuhart , David Négrier " + +# |-------------------------------------------------------------------------- +# | Required libraries +# |-------------------------------------------------------------------------- +# | +# | Installs required libraries. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends curl git nano sudo ca-certificates procps libfontconfig tini --no-install-recommends + +# |-------------------------------------------------------------------------- +# | Supercronic +# |-------------------------------------------------------------------------- +# | +# | Supercronic is a drop-in replacement for cron (for containers). +# | + +RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.12/supercronic-linux-$( dpkg --print-architecture ) \ + && SUPERCRONIC=supercronic-linux-$( dpkg --print-architecture ) \ + && curl -fsSLO "$SUPERCRONIC_URL" \ + && chmod +x "$SUPERCRONIC" \ + && mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \ + && ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic + + # |-------------------------------------------------------------------------- + # | User + # |-------------------------------------------------------------------------- + # | + # | Define a default user with sudo rights. + # | + + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker + # Users in the sudoers group can sudo as root without password. + RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + + + + +# |-------------------------------------------------------------------------- +# | NodeJS +# |-------------------------------------------------------------------------- +# | +# | Installs NodeJS and npm. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends gnupg &&\ + mkdir -p /etc/apt/keyrings && \ + curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ + echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list &&\ + apt-get update &&\ + apt-get install -y --no-install-recommends nodejs + +# |-------------------------------------------------------------------------- +# | yarn +# |-------------------------------------------------------------------------- +# | +# | Installs yarn. It provides some nice improvements over npm. +# | + +RUN corepack enable && corepack prepare yarn@stable --activate + +# |-------------------------------------------------------------------------- +# | PATH updating +# |-------------------------------------------------------------------------- +# | +# | Let's add ./node_modules/.bin to the PATH (utility function to use NPM bin easily) +# | + +ENV PATH="$PATH:./node_modules/.bin" +RUN sed -i 's#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:./node_modules/.bin#g' /etc/sudoers + +USER docker +# |-------------------------------------------------------------------------- +# | SSH client +# |-------------------------------------------------------------------------- +# | +# | Let's set-up the SSH client (for connections to private git repositories) +# | We create an empty known_host file and we launch the ssh-agent +# | + +RUN mkdir ~/.ssh && touch ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts && eval $(ssh-agent -s) + +# |-------------------------------------------------------------------------- +# | .bashrc updating +# |-------------------------------------------------------------------------- +# | +# | Let's update the .bashrc to add nice aliases +# | +RUN { \ + echo "alias ls='ls --color=auto'"; \ + echo "alias ll='ls --color=auto -alF'"; \ + echo "alias la='ls --color=auto -A'"; \ + echo "alias l='ls --color=auto -CF'"; \ + } >> ~/.bashrc + +USER root + +# |-------------------------------------------------------------------------- +# | Entrypoint +# |-------------------------------------------------------------------------- +# | +# | Defines the entrypoint. +# | + +ENV NODE_VERSION=22.x + + +RUN mkdir -p /usr/src/app && chown docker:docker /usr/src/app +WORKDIR /usr/src/app + + +COPY utils/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh +COPY utils/docker-entrypoint-as-root.sh /usr/local/bin/docker-entrypoint-as-root.sh +COPY utils/startup_commands.js /usr/local/bin/startup_commands.js +COPY utils/generate_cron.js /usr/local/bin/generate_cron.js + + + +CMD [ "node" ] + + + +# Let's install the build tools (useful for node-gyp) +RUN apt-get update &&\ + apt-get install -y --no-install-recommends build-essential + + +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] + + +USER docker diff --git a/Dockerfile.24-apache-bullseye b/Dockerfile.24-apache-bullseye index 96dc151..fc211a9 100644 --- a/Dockerfile.24-apache-bullseye +++ b/Dockerfile.24-apache-bullseye @@ -1,4 +1,4 @@ -# DO NOT EDIT THIS FILE : Make yours changes in /utils/Dockerfile.blueprint) +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) FROM debian:bullseye-slim LABEL authors="Julien Neuhart , David Négrier " @@ -34,7 +34,7 @@ RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0. # | Define a default user with sudo rights. # | - RUN useradd -ms /bin/bash docker && adduser docker sudo + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker # Users in the sudoers group can sudo as root without password. RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers diff --git a/Dockerfile.24-apache-bullseye-build b/Dockerfile.24-apache-bullseye-build index 60d4100..d7fe2b7 100644 --- a/Dockerfile.24-apache-bullseye-build +++ b/Dockerfile.24-apache-bullseye-build @@ -1,4 +1,4 @@ -# DO NOT EDIT THIS FILE : Make yours changes in /utils/Dockerfile.blueprint) +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) FROM debian:bullseye-slim LABEL authors="Julien Neuhart , David Négrier " @@ -34,7 +34,7 @@ RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0. # | Define a default user with sudo rights. # | - RUN useradd -ms /bin/bash docker && adduser docker sudo + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker # Users in the sudoers group can sudo as root without password. RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers diff --git a/Dockerfile.24-apache-trixie b/Dockerfile.24-apache-trixie new file mode 100644 index 0000000..b809621 --- /dev/null +++ b/Dockerfile.24-apache-trixie @@ -0,0 +1,225 @@ +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) +FROM debian:trixie-slim + +LABEL authors="Julien Neuhart , David Négrier " + +# |-------------------------------------------------------------------------- +# | Required libraries +# |-------------------------------------------------------------------------- +# | +# | Installs required libraries. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends curl git nano sudo ca-certificates procps libfontconfig tini --no-install-recommends + +# |-------------------------------------------------------------------------- +# | Supercronic +# |-------------------------------------------------------------------------- +# | +# | Supercronic is a drop-in replacement for cron (for containers). +# | + +RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.12/supercronic-linux-$( dpkg --print-architecture ) \ + && SUPERCRONIC=supercronic-linux-$( dpkg --print-architecture ) \ + && curl -fsSLO "$SUPERCRONIC_URL" \ + && chmod +x "$SUPERCRONIC" \ + && mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \ + && ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic + + # |-------------------------------------------------------------------------- + # | User + # |-------------------------------------------------------------------------- + # | + # | Define a default user with sudo rights. + # | + + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker + # Users in the sudoers group can sudo as root without password. + RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + + + +# |-------------------------------------------------------------------------- +# | Apache +# |-------------------------------------------------------------------------- +# | +# | Installs Apache. +# | + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + apache2 \ + && rm -rf /var/lib/apt/lists/* + +ENV APACHE_CONFDIR /etc/apache2 +ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars + +RUN set -ex \ + \ +# generically convert lines like +# export APACHE_RUN_USER=www-data +# into +# : ${APACHE_RUN_USER:=www-data} +# export APACHE_RUN_USER +# so that they can be overridden at runtime ("-e APACHE_RUN_USER=...") + && sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS" \ + \ +# setup directories and permissions + && . "$APACHE_ENVVARS" \ + && for dir in \ + "$APACHE_LOCK_DIR" \ + "$APACHE_RUN_DIR" \ + "$APACHE_LOG_DIR" \ + /var/www/html \ + ; do \ + rm -rvf "$dir" \ + && mkdir -p "$dir" \ + && chown -R "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir"; \ + done + +# logs should go to stdout / stderr +RUN set -ex \ + && . "$APACHE_ENVVARS" \ + && ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log" \ + && ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log" \ + && ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log" + +ENV APACHE_DOCUMENT_ROOT / + +RUN { \ + echo 'DirectoryIndex disabled'; \ + echo 'DirectoryIndex index.html'; \ + echo; \ + echo ''; \ + echo '\tOptions -Indexes'; \ + echo '\tAllowOverride All'; \ + echo ''; \ + } | tee "$APACHE_CONFDIR/conf-available/nodejs.conf" \ + && a2enconf nodejs + +RUN sed -ri -e 's!/var/www/html!/var/www/html/${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf +RUN sed -ri -e 's!/var/www/!/var/www/html/${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf + +# |-------------------------------------------------------------------------- +# | Apache mod_rewrite +# |-------------------------------------------------------------------------- +# | +# | Enables Apache mod_rewrite. +# | + +RUN a2enmod rewrite + + +# |-------------------------------------------------------------------------- +# | NodeJS +# |-------------------------------------------------------------------------- +# | +# | Installs NodeJS and npm. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends gnupg &&\ + mkdir -p /etc/apt/keyrings && \ + curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ + echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_24.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list &&\ + apt-get update &&\ + apt-get install -y --no-install-recommends nodejs + +# |-------------------------------------------------------------------------- +# | yarn +# |-------------------------------------------------------------------------- +# | +# | Installs yarn. It provides some nice improvements over npm. +# | + +RUN corepack enable && corepack prepare yarn@stable --activate + +# |-------------------------------------------------------------------------- +# | PATH updating +# |-------------------------------------------------------------------------- +# | +# | Let's add ./node_modules/.bin to the PATH (utility function to use NPM bin easily) +# | + +ENV PATH="$PATH:./node_modules/.bin" +RUN sed -i 's#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:./node_modules/.bin#g' /etc/sudoers + +USER docker +# |-------------------------------------------------------------------------- +# | SSH client +# |-------------------------------------------------------------------------- +# | +# | Let's set-up the SSH client (for connections to private git repositories) +# | We create an empty known_host file and we launch the ssh-agent +# | + +RUN mkdir ~/.ssh && touch ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts && eval $(ssh-agent -s) + +# |-------------------------------------------------------------------------- +# | .bashrc updating +# |-------------------------------------------------------------------------- +# | +# | Let's update the .bashrc to add nice aliases +# | +RUN { \ + echo "alias ls='ls --color=auto'"; \ + echo "alias ll='ls --color=auto -alF'"; \ + echo "alias la='ls --color=auto -A'"; \ + echo "alias l='ls --color=auto -CF'"; \ + } >> ~/.bashrc + +USER root + +# |-------------------------------------------------------------------------- +# | Entrypoint +# |-------------------------------------------------------------------------- +# | +# | Defines the entrypoint. +# | + +ENV NODE_VERSION=24.x + + +RUN mkdir -p /var/www/html && chown docker:docker /var/www/html +WORKDIR /var/www/html + + +COPY utils/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh +COPY utils/docker-entrypoint-as-root.sh /usr/local/bin/docker-entrypoint-as-root.sh +COPY utils/startup_commands.js /usr/local/bin/startup_commands.js +COPY utils/generate_cron.js /usr/local/bin/generate_cron.js + + + +COPY utils/enable_apache_mods.js /usr/local/bin/enable_apache_mods.js +COPY utils/apache-expose-envvars.sh /usr/local/bin/apache-expose-envvars.sh + +# Let's register a servername to remove the message "apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message" +RUN echo "ServerName localhost" > /etc/apache2/conf-available/servername.conf +RUN a2enconf servername + +EXPOSE 80 + +# |-------------------------------------------------------------------------- +# | Apache user +# |-------------------------------------------------------------------------- +# | +# | Defines Apache user. By default, we switch this to "docker" user. +# | This way, no problem to write from Apache in the current working directory. +# | Important! This should be changed back to www-data in production. +# | + +ENV APACHE_RUN_USER=docker \ + APACHE_RUN_GROUP=docker + +COPY utils/apache2-foreground /usr/local/bin/ +CMD ["apache2-foreground"] + + + + +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] + + +USER docker diff --git a/Dockerfile.24-apache-trixie-build b/Dockerfile.24-apache-trixie-build new file mode 100644 index 0000000..c707b8b --- /dev/null +++ b/Dockerfile.24-apache-trixie-build @@ -0,0 +1,229 @@ +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) +FROM debian:trixie-slim + +LABEL authors="Julien Neuhart , David Négrier " + +# |-------------------------------------------------------------------------- +# | Required libraries +# |-------------------------------------------------------------------------- +# | +# | Installs required libraries. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends curl git nano sudo ca-certificates procps libfontconfig tini --no-install-recommends + +# |-------------------------------------------------------------------------- +# | Supercronic +# |-------------------------------------------------------------------------- +# | +# | Supercronic is a drop-in replacement for cron (for containers). +# | + +RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.12/supercronic-linux-$( dpkg --print-architecture ) \ + && SUPERCRONIC=supercronic-linux-$( dpkg --print-architecture ) \ + && curl -fsSLO "$SUPERCRONIC_URL" \ + && chmod +x "$SUPERCRONIC" \ + && mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \ + && ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic + + # |-------------------------------------------------------------------------- + # | User + # |-------------------------------------------------------------------------- + # | + # | Define a default user with sudo rights. + # | + + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker + # Users in the sudoers group can sudo as root without password. + RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + + + +# |-------------------------------------------------------------------------- +# | Apache +# |-------------------------------------------------------------------------- +# | +# | Installs Apache. +# | + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + apache2 \ + && rm -rf /var/lib/apt/lists/* + +ENV APACHE_CONFDIR /etc/apache2 +ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars + +RUN set -ex \ + \ +# generically convert lines like +# export APACHE_RUN_USER=www-data +# into +# : ${APACHE_RUN_USER:=www-data} +# export APACHE_RUN_USER +# so that they can be overridden at runtime ("-e APACHE_RUN_USER=...") + && sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS" \ + \ +# setup directories and permissions + && . "$APACHE_ENVVARS" \ + && for dir in \ + "$APACHE_LOCK_DIR" \ + "$APACHE_RUN_DIR" \ + "$APACHE_LOG_DIR" \ + /var/www/html \ + ; do \ + rm -rvf "$dir" \ + && mkdir -p "$dir" \ + && chown -R "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir"; \ + done + +# logs should go to stdout / stderr +RUN set -ex \ + && . "$APACHE_ENVVARS" \ + && ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log" \ + && ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log" \ + && ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log" + +ENV APACHE_DOCUMENT_ROOT / + +RUN { \ + echo 'DirectoryIndex disabled'; \ + echo 'DirectoryIndex index.html'; \ + echo; \ + echo ''; \ + echo '\tOptions -Indexes'; \ + echo '\tAllowOverride All'; \ + echo ''; \ + } | tee "$APACHE_CONFDIR/conf-available/nodejs.conf" \ + && a2enconf nodejs + +RUN sed -ri -e 's!/var/www/html!/var/www/html/${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf +RUN sed -ri -e 's!/var/www/!/var/www/html/${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf + +# |-------------------------------------------------------------------------- +# | Apache mod_rewrite +# |-------------------------------------------------------------------------- +# | +# | Enables Apache mod_rewrite. +# | + +RUN a2enmod rewrite + + +# |-------------------------------------------------------------------------- +# | NodeJS +# |-------------------------------------------------------------------------- +# | +# | Installs NodeJS and npm. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends gnupg &&\ + mkdir -p /etc/apt/keyrings && \ + curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ + echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_24.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list &&\ + apt-get update &&\ + apt-get install -y --no-install-recommends nodejs + +# |-------------------------------------------------------------------------- +# | yarn +# |-------------------------------------------------------------------------- +# | +# | Installs yarn. It provides some nice improvements over npm. +# | + +RUN corepack enable && corepack prepare yarn@stable --activate + +# |-------------------------------------------------------------------------- +# | PATH updating +# |-------------------------------------------------------------------------- +# | +# | Let's add ./node_modules/.bin to the PATH (utility function to use NPM bin easily) +# | + +ENV PATH="$PATH:./node_modules/.bin" +RUN sed -i 's#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:./node_modules/.bin#g' /etc/sudoers + +USER docker +# |-------------------------------------------------------------------------- +# | SSH client +# |-------------------------------------------------------------------------- +# | +# | Let's set-up the SSH client (for connections to private git repositories) +# | We create an empty known_host file and we launch the ssh-agent +# | + +RUN mkdir ~/.ssh && touch ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts && eval $(ssh-agent -s) + +# |-------------------------------------------------------------------------- +# | .bashrc updating +# |-------------------------------------------------------------------------- +# | +# | Let's update the .bashrc to add nice aliases +# | +RUN { \ + echo "alias ls='ls --color=auto'"; \ + echo "alias ll='ls --color=auto -alF'"; \ + echo "alias la='ls --color=auto -A'"; \ + echo "alias l='ls --color=auto -CF'"; \ + } >> ~/.bashrc + +USER root + +# |-------------------------------------------------------------------------- +# | Entrypoint +# |-------------------------------------------------------------------------- +# | +# | Defines the entrypoint. +# | + +ENV NODE_VERSION=24.x + + +RUN mkdir -p /var/www/html && chown docker:docker /var/www/html +WORKDIR /var/www/html + + +COPY utils/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh +COPY utils/docker-entrypoint-as-root.sh /usr/local/bin/docker-entrypoint-as-root.sh +COPY utils/startup_commands.js /usr/local/bin/startup_commands.js +COPY utils/generate_cron.js /usr/local/bin/generate_cron.js + + + +COPY utils/enable_apache_mods.js /usr/local/bin/enable_apache_mods.js +COPY utils/apache-expose-envvars.sh /usr/local/bin/apache-expose-envvars.sh + +# Let's register a servername to remove the message "apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message" +RUN echo "ServerName localhost" > /etc/apache2/conf-available/servername.conf +RUN a2enconf servername + +EXPOSE 80 + +# |-------------------------------------------------------------------------- +# | Apache user +# |-------------------------------------------------------------------------- +# | +# | Defines Apache user. By default, we switch this to "docker" user. +# | This way, no problem to write from Apache in the current working directory. +# | Important! This should be changed back to www-data in production. +# | + +ENV APACHE_RUN_USER=docker \ + APACHE_RUN_GROUP=docker + +COPY utils/apache2-foreground /usr/local/bin/ +CMD ["apache2-foreground"] + + + +# Let's install the build tools (useful for node-gyp) +RUN apt-get update &&\ + apt-get install -y --no-install-recommends build-essential + + +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] + + +USER docker diff --git a/Dockerfile.24-bullseye b/Dockerfile.24-bullseye index 7f3ab55..9c08773 100644 --- a/Dockerfile.24-bullseye +++ b/Dockerfile.24-bullseye @@ -1,4 +1,4 @@ -# DO NOT EDIT THIS FILE : Make yours changes in /utils/Dockerfile.blueprint) +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) FROM debian:bullseye-slim LABEL authors="Julien Neuhart , David Négrier " @@ -34,7 +34,7 @@ RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0. # | Define a default user with sudo rights. # | - RUN useradd -ms /bin/bash docker && adduser docker sudo + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker # Users in the sudoers group can sudo as root without password. RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers diff --git a/Dockerfile.24-bullseye-build b/Dockerfile.24-bullseye-build index 03daacf..a82d9a8 100644 --- a/Dockerfile.24-bullseye-build +++ b/Dockerfile.24-bullseye-build @@ -1,4 +1,4 @@ -# DO NOT EDIT THIS FILE : Make yours changes in /utils/Dockerfile.blueprint) +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) FROM debian:bullseye-slim LABEL authors="Julien Neuhart , David Négrier " @@ -34,7 +34,7 @@ RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0. # | Define a default user with sudo rights. # | - RUN useradd -ms /bin/bash docker && adduser docker sudo + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker # Users in the sudoers group can sudo as root without password. RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers diff --git a/Dockerfile.24-trixie b/Dockerfile.24-trixie new file mode 100644 index 0000000..d1b6d5a --- /dev/null +++ b/Dockerfile.24-trixie @@ -0,0 +1,133 @@ +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) +FROM debian:trixie-slim + +LABEL authors="Julien Neuhart , David Négrier " + +# |-------------------------------------------------------------------------- +# | Required libraries +# |-------------------------------------------------------------------------- +# | +# | Installs required libraries. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends curl git nano sudo ca-certificates procps libfontconfig tini --no-install-recommends + +# |-------------------------------------------------------------------------- +# | Supercronic +# |-------------------------------------------------------------------------- +# | +# | Supercronic is a drop-in replacement for cron (for containers). +# | + +RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.12/supercronic-linux-$( dpkg --print-architecture ) \ + && SUPERCRONIC=supercronic-linux-$( dpkg --print-architecture ) \ + && curl -fsSLO "$SUPERCRONIC_URL" \ + && chmod +x "$SUPERCRONIC" \ + && mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \ + && ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic + + # |-------------------------------------------------------------------------- + # | User + # |-------------------------------------------------------------------------- + # | + # | Define a default user with sudo rights. + # | + + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker + # Users in the sudoers group can sudo as root without password. + RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + + + + +# |-------------------------------------------------------------------------- +# | NodeJS +# |-------------------------------------------------------------------------- +# | +# | Installs NodeJS and npm. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends gnupg &&\ + mkdir -p /etc/apt/keyrings && \ + curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ + echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_24.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list &&\ + apt-get update &&\ + apt-get install -y --no-install-recommends nodejs + +# |-------------------------------------------------------------------------- +# | yarn +# |-------------------------------------------------------------------------- +# | +# | Installs yarn. It provides some nice improvements over npm. +# | + +RUN corepack enable && corepack prepare yarn@stable --activate + +# |-------------------------------------------------------------------------- +# | PATH updating +# |-------------------------------------------------------------------------- +# | +# | Let's add ./node_modules/.bin to the PATH (utility function to use NPM bin easily) +# | + +ENV PATH="$PATH:./node_modules/.bin" +RUN sed -i 's#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:./node_modules/.bin#g' /etc/sudoers + +USER docker +# |-------------------------------------------------------------------------- +# | SSH client +# |-------------------------------------------------------------------------- +# | +# | Let's set-up the SSH client (for connections to private git repositories) +# | We create an empty known_host file and we launch the ssh-agent +# | + +RUN mkdir ~/.ssh && touch ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts && eval $(ssh-agent -s) + +# |-------------------------------------------------------------------------- +# | .bashrc updating +# |-------------------------------------------------------------------------- +# | +# | Let's update the .bashrc to add nice aliases +# | +RUN { \ + echo "alias ls='ls --color=auto'"; \ + echo "alias ll='ls --color=auto -alF'"; \ + echo "alias la='ls --color=auto -A'"; \ + echo "alias l='ls --color=auto -CF'"; \ + } >> ~/.bashrc + +USER root + +# |-------------------------------------------------------------------------- +# | Entrypoint +# |-------------------------------------------------------------------------- +# | +# | Defines the entrypoint. +# | + +ENV NODE_VERSION=24.x + + +RUN mkdir -p /usr/src/app && chown docker:docker /usr/src/app +WORKDIR /usr/src/app + + +COPY utils/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh +COPY utils/docker-entrypoint-as-root.sh /usr/local/bin/docker-entrypoint-as-root.sh +COPY utils/startup_commands.js /usr/local/bin/startup_commands.js +COPY utils/generate_cron.js /usr/local/bin/generate_cron.js + + + +CMD [ "node" ] + + + + +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] + + +USER docker diff --git a/Dockerfile.24-trixie-build b/Dockerfile.24-trixie-build new file mode 100644 index 0000000..e1b2a73 --- /dev/null +++ b/Dockerfile.24-trixie-build @@ -0,0 +1,137 @@ +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) +FROM debian:trixie-slim + +LABEL authors="Julien Neuhart , David Négrier " + +# |-------------------------------------------------------------------------- +# | Required libraries +# |-------------------------------------------------------------------------- +# | +# | Installs required libraries. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends curl git nano sudo ca-certificates procps libfontconfig tini --no-install-recommends + +# |-------------------------------------------------------------------------- +# | Supercronic +# |-------------------------------------------------------------------------- +# | +# | Supercronic is a drop-in replacement for cron (for containers). +# | + +RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.12/supercronic-linux-$( dpkg --print-architecture ) \ + && SUPERCRONIC=supercronic-linux-$( dpkg --print-architecture ) \ + && curl -fsSLO "$SUPERCRONIC_URL" \ + && chmod +x "$SUPERCRONIC" \ + && mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \ + && ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic + + # |-------------------------------------------------------------------------- + # | User + # |-------------------------------------------------------------------------- + # | + # | Define a default user with sudo rights. + # | + + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker + # Users in the sudoers group can sudo as root without password. + RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + + + + +# |-------------------------------------------------------------------------- +# | NodeJS +# |-------------------------------------------------------------------------- +# | +# | Installs NodeJS and npm. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends gnupg &&\ + mkdir -p /etc/apt/keyrings && \ + curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ + echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_24.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list &&\ + apt-get update &&\ + apt-get install -y --no-install-recommends nodejs + +# |-------------------------------------------------------------------------- +# | yarn +# |-------------------------------------------------------------------------- +# | +# | Installs yarn. It provides some nice improvements over npm. +# | + +RUN corepack enable && corepack prepare yarn@stable --activate + +# |-------------------------------------------------------------------------- +# | PATH updating +# |-------------------------------------------------------------------------- +# | +# | Let's add ./node_modules/.bin to the PATH (utility function to use NPM bin easily) +# | + +ENV PATH="$PATH:./node_modules/.bin" +RUN sed -i 's#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:./node_modules/.bin#g' /etc/sudoers + +USER docker +# |-------------------------------------------------------------------------- +# | SSH client +# |-------------------------------------------------------------------------- +# | +# | Let's set-up the SSH client (for connections to private git repositories) +# | We create an empty known_host file and we launch the ssh-agent +# | + +RUN mkdir ~/.ssh && touch ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts && eval $(ssh-agent -s) + +# |-------------------------------------------------------------------------- +# | .bashrc updating +# |-------------------------------------------------------------------------- +# | +# | Let's update the .bashrc to add nice aliases +# | +RUN { \ + echo "alias ls='ls --color=auto'"; \ + echo "alias ll='ls --color=auto -alF'"; \ + echo "alias la='ls --color=auto -A'"; \ + echo "alias l='ls --color=auto -CF'"; \ + } >> ~/.bashrc + +USER root + +# |-------------------------------------------------------------------------- +# | Entrypoint +# |-------------------------------------------------------------------------- +# | +# | Defines the entrypoint. +# | + +ENV NODE_VERSION=24.x + + +RUN mkdir -p /usr/src/app && chown docker:docker /usr/src/app +WORKDIR /usr/src/app + + +COPY utils/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh +COPY utils/docker-entrypoint-as-root.sh /usr/local/bin/docker-entrypoint-as-root.sh +COPY utils/startup_commands.js /usr/local/bin/startup_commands.js +COPY utils/generate_cron.js /usr/local/bin/generate_cron.js + + + +CMD [ "node" ] + + + +# Let's install the build tools (useful for node-gyp) +RUN apt-get update &&\ + apt-get install -y --no-install-recommends build-essential + + +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] + + +USER docker diff --git a/Dockerfile.26-apache-bullseye b/Dockerfile.26-apache-bullseye index 0039400..96e9f5d 100644 --- a/Dockerfile.26-apache-bullseye +++ b/Dockerfile.26-apache-bullseye @@ -1,4 +1,4 @@ -# DO NOT EDIT THIS FILE : Make yours changes in /utils/Dockerfile.blueprint) +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) FROM debian:bullseye-slim LABEL authors="Julien Neuhart , David Négrier " @@ -34,7 +34,7 @@ RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0. # | Define a default user with sudo rights. # | - RUN useradd -ms /bin/bash docker && adduser docker sudo + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker # Users in the sudoers group can sudo as root without password. RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers @@ -124,7 +124,7 @@ RUN apt-get update &&\ curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_26.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list &&\ apt-get update &&\ - apt-get install -y --no-install-recommends nodejs&& \ + apt-get install -y --no-install-recommends nodejs && \ npm install -g corepack@latest # |-------------------------------------------------------------------------- diff --git a/Dockerfile.26-apache-bullseye-build b/Dockerfile.26-apache-bullseye-build index dd4c730..acd3734 100644 --- a/Dockerfile.26-apache-bullseye-build +++ b/Dockerfile.26-apache-bullseye-build @@ -1,4 +1,4 @@ -# DO NOT EDIT THIS FILE : Make yours changes in /utils/Dockerfile.blueprint) +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) FROM debian:bullseye-slim LABEL authors="Julien Neuhart , David Négrier " @@ -34,7 +34,7 @@ RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0. # | Define a default user with sudo rights. # | - RUN useradd -ms /bin/bash docker && adduser docker sudo + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker # Users in the sudoers group can sudo as root without password. RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers @@ -124,7 +124,7 @@ RUN apt-get update &&\ curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_26.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list &&\ apt-get update &&\ - apt-get install -y --no-install-recommends nodejs&& \ + apt-get install -y --no-install-recommends nodejs && \ npm install -g corepack@latest # |-------------------------------------------------------------------------- diff --git a/Dockerfile.26-apache-trixie b/Dockerfile.26-apache-trixie new file mode 100644 index 0000000..1adc105 --- /dev/null +++ b/Dockerfile.26-apache-trixie @@ -0,0 +1,226 @@ +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) +FROM debian:trixie-slim + +LABEL authors="Julien Neuhart , David Négrier " + +# |-------------------------------------------------------------------------- +# | Required libraries +# |-------------------------------------------------------------------------- +# | +# | Installs required libraries. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends curl git nano sudo ca-certificates procps libfontconfig tini --no-install-recommends + +# |-------------------------------------------------------------------------- +# | Supercronic +# |-------------------------------------------------------------------------- +# | +# | Supercronic is a drop-in replacement for cron (for containers). +# | + +RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.12/supercronic-linux-$( dpkg --print-architecture ) \ + && SUPERCRONIC=supercronic-linux-$( dpkg --print-architecture ) \ + && curl -fsSLO "$SUPERCRONIC_URL" \ + && chmod +x "$SUPERCRONIC" \ + && mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \ + && ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic + + # |-------------------------------------------------------------------------- + # | User + # |-------------------------------------------------------------------------- + # | + # | Define a default user with sudo rights. + # | + + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker + # Users in the sudoers group can sudo as root without password. + RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + + + +# |-------------------------------------------------------------------------- +# | Apache +# |-------------------------------------------------------------------------- +# | +# | Installs Apache. +# | + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + apache2 \ + && rm -rf /var/lib/apt/lists/* + +ENV APACHE_CONFDIR /etc/apache2 +ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars + +RUN set -ex \ + \ +# generically convert lines like +# export APACHE_RUN_USER=www-data +# into +# : ${APACHE_RUN_USER:=www-data} +# export APACHE_RUN_USER +# so that they can be overridden at runtime ("-e APACHE_RUN_USER=...") + && sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS" \ + \ +# setup directories and permissions + && . "$APACHE_ENVVARS" \ + && for dir in \ + "$APACHE_LOCK_DIR" \ + "$APACHE_RUN_DIR" \ + "$APACHE_LOG_DIR" \ + /var/www/html \ + ; do \ + rm -rvf "$dir" \ + && mkdir -p "$dir" \ + && chown -R "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir"; \ + done + +# logs should go to stdout / stderr +RUN set -ex \ + && . "$APACHE_ENVVARS" \ + && ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log" \ + && ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log" \ + && ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log" + +ENV APACHE_DOCUMENT_ROOT / + +RUN { \ + echo 'DirectoryIndex disabled'; \ + echo 'DirectoryIndex index.html'; \ + echo; \ + echo ''; \ + echo '\tOptions -Indexes'; \ + echo '\tAllowOverride All'; \ + echo ''; \ + } | tee "$APACHE_CONFDIR/conf-available/nodejs.conf" \ + && a2enconf nodejs + +RUN sed -ri -e 's!/var/www/html!/var/www/html/${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf +RUN sed -ri -e 's!/var/www/!/var/www/html/${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf + +# |-------------------------------------------------------------------------- +# | Apache mod_rewrite +# |-------------------------------------------------------------------------- +# | +# | Enables Apache mod_rewrite. +# | + +RUN a2enmod rewrite + + +# |-------------------------------------------------------------------------- +# | NodeJS +# |-------------------------------------------------------------------------- +# | +# | Installs NodeJS and npm. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends gnupg &&\ + mkdir -p /etc/apt/keyrings && \ + curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ + echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_26.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list &&\ + apt-get update &&\ + apt-get install -y --no-install-recommends nodejs && \ + npm install -g corepack@latest + +# |-------------------------------------------------------------------------- +# | yarn +# |-------------------------------------------------------------------------- +# | +# | Installs yarn. It provides some nice improvements over npm. +# | + +RUN corepack enable && corepack prepare yarn@stable --activate + +# |-------------------------------------------------------------------------- +# | PATH updating +# |-------------------------------------------------------------------------- +# | +# | Let's add ./node_modules/.bin to the PATH (utility function to use NPM bin easily) +# | + +ENV PATH="$PATH:./node_modules/.bin" +RUN sed -i 's#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:./node_modules/.bin#g' /etc/sudoers + +USER docker +# |-------------------------------------------------------------------------- +# | SSH client +# |-------------------------------------------------------------------------- +# | +# | Let's set-up the SSH client (for connections to private git repositories) +# | We create an empty known_host file and we launch the ssh-agent +# | + +RUN mkdir ~/.ssh && touch ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts && eval $(ssh-agent -s) + +# |-------------------------------------------------------------------------- +# | .bashrc updating +# |-------------------------------------------------------------------------- +# | +# | Let's update the .bashrc to add nice aliases +# | +RUN { \ + echo "alias ls='ls --color=auto'"; \ + echo "alias ll='ls --color=auto -alF'"; \ + echo "alias la='ls --color=auto -A'"; \ + echo "alias l='ls --color=auto -CF'"; \ + } >> ~/.bashrc + +USER root + +# |-------------------------------------------------------------------------- +# | Entrypoint +# |-------------------------------------------------------------------------- +# | +# | Defines the entrypoint. +# | + +ENV NODE_VERSION=26.x + + +RUN mkdir -p /var/www/html && chown docker:docker /var/www/html +WORKDIR /var/www/html + + +COPY utils/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh +COPY utils/docker-entrypoint-as-root.sh /usr/local/bin/docker-entrypoint-as-root.sh +COPY utils/startup_commands.js /usr/local/bin/startup_commands.js +COPY utils/generate_cron.js /usr/local/bin/generate_cron.js + + + +COPY utils/enable_apache_mods.js /usr/local/bin/enable_apache_mods.js +COPY utils/apache-expose-envvars.sh /usr/local/bin/apache-expose-envvars.sh + +# Let's register a servername to remove the message "apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message" +RUN echo "ServerName localhost" > /etc/apache2/conf-available/servername.conf +RUN a2enconf servername + +EXPOSE 80 + +# |-------------------------------------------------------------------------- +# | Apache user +# |-------------------------------------------------------------------------- +# | +# | Defines Apache user. By default, we switch this to "docker" user. +# | This way, no problem to write from Apache in the current working directory. +# | Important! This should be changed back to www-data in production. +# | + +ENV APACHE_RUN_USER=docker \ + APACHE_RUN_GROUP=docker + +COPY utils/apache2-foreground /usr/local/bin/ +CMD ["apache2-foreground"] + + + + +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] + + +USER docker diff --git a/Dockerfile.26-apache-trixie-build b/Dockerfile.26-apache-trixie-build new file mode 100644 index 0000000..d9f33aa --- /dev/null +++ b/Dockerfile.26-apache-trixie-build @@ -0,0 +1,230 @@ +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) +FROM debian:trixie-slim + +LABEL authors="Julien Neuhart , David Négrier " + +# |-------------------------------------------------------------------------- +# | Required libraries +# |-------------------------------------------------------------------------- +# | +# | Installs required libraries. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends curl git nano sudo ca-certificates procps libfontconfig tini --no-install-recommends + +# |-------------------------------------------------------------------------- +# | Supercronic +# |-------------------------------------------------------------------------- +# | +# | Supercronic is a drop-in replacement for cron (for containers). +# | + +RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.12/supercronic-linux-$( dpkg --print-architecture ) \ + && SUPERCRONIC=supercronic-linux-$( dpkg --print-architecture ) \ + && curl -fsSLO "$SUPERCRONIC_URL" \ + && chmod +x "$SUPERCRONIC" \ + && mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \ + && ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic + + # |-------------------------------------------------------------------------- + # | User + # |-------------------------------------------------------------------------- + # | + # | Define a default user with sudo rights. + # | + + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker + # Users in the sudoers group can sudo as root without password. + RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + + + +# |-------------------------------------------------------------------------- +# | Apache +# |-------------------------------------------------------------------------- +# | +# | Installs Apache. +# | + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + apache2 \ + && rm -rf /var/lib/apt/lists/* + +ENV APACHE_CONFDIR /etc/apache2 +ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars + +RUN set -ex \ + \ +# generically convert lines like +# export APACHE_RUN_USER=www-data +# into +# : ${APACHE_RUN_USER:=www-data} +# export APACHE_RUN_USER +# so that they can be overridden at runtime ("-e APACHE_RUN_USER=...") + && sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS" \ + \ +# setup directories and permissions + && . "$APACHE_ENVVARS" \ + && for dir in \ + "$APACHE_LOCK_DIR" \ + "$APACHE_RUN_DIR" \ + "$APACHE_LOG_DIR" \ + /var/www/html \ + ; do \ + rm -rvf "$dir" \ + && mkdir -p "$dir" \ + && chown -R "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir"; \ + done + +# logs should go to stdout / stderr +RUN set -ex \ + && . "$APACHE_ENVVARS" \ + && ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log" \ + && ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log" \ + && ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log" + +ENV APACHE_DOCUMENT_ROOT / + +RUN { \ + echo 'DirectoryIndex disabled'; \ + echo 'DirectoryIndex index.html'; \ + echo; \ + echo ''; \ + echo '\tOptions -Indexes'; \ + echo '\tAllowOverride All'; \ + echo ''; \ + } | tee "$APACHE_CONFDIR/conf-available/nodejs.conf" \ + && a2enconf nodejs + +RUN sed -ri -e 's!/var/www/html!/var/www/html/${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf +RUN sed -ri -e 's!/var/www/!/var/www/html/${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf + +# |-------------------------------------------------------------------------- +# | Apache mod_rewrite +# |-------------------------------------------------------------------------- +# | +# | Enables Apache mod_rewrite. +# | + +RUN a2enmod rewrite + + +# |-------------------------------------------------------------------------- +# | NodeJS +# |-------------------------------------------------------------------------- +# | +# | Installs NodeJS and npm. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends gnupg &&\ + mkdir -p /etc/apt/keyrings && \ + curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ + echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_26.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list &&\ + apt-get update &&\ + apt-get install -y --no-install-recommends nodejs && \ + npm install -g corepack@latest + +# |-------------------------------------------------------------------------- +# | yarn +# |-------------------------------------------------------------------------- +# | +# | Installs yarn. It provides some nice improvements over npm. +# | + +RUN corepack enable && corepack prepare yarn@stable --activate + +# |-------------------------------------------------------------------------- +# | PATH updating +# |-------------------------------------------------------------------------- +# | +# | Let's add ./node_modules/.bin to the PATH (utility function to use NPM bin easily) +# | + +ENV PATH="$PATH:./node_modules/.bin" +RUN sed -i 's#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:./node_modules/.bin#g' /etc/sudoers + +USER docker +# |-------------------------------------------------------------------------- +# | SSH client +# |-------------------------------------------------------------------------- +# | +# | Let's set-up the SSH client (for connections to private git repositories) +# | We create an empty known_host file and we launch the ssh-agent +# | + +RUN mkdir ~/.ssh && touch ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts && eval $(ssh-agent -s) + +# |-------------------------------------------------------------------------- +# | .bashrc updating +# |-------------------------------------------------------------------------- +# | +# | Let's update the .bashrc to add nice aliases +# | +RUN { \ + echo "alias ls='ls --color=auto'"; \ + echo "alias ll='ls --color=auto -alF'"; \ + echo "alias la='ls --color=auto -A'"; \ + echo "alias l='ls --color=auto -CF'"; \ + } >> ~/.bashrc + +USER root + +# |-------------------------------------------------------------------------- +# | Entrypoint +# |-------------------------------------------------------------------------- +# | +# | Defines the entrypoint. +# | + +ENV NODE_VERSION=26.x + + +RUN mkdir -p /var/www/html && chown docker:docker /var/www/html +WORKDIR /var/www/html + + +COPY utils/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh +COPY utils/docker-entrypoint-as-root.sh /usr/local/bin/docker-entrypoint-as-root.sh +COPY utils/startup_commands.js /usr/local/bin/startup_commands.js +COPY utils/generate_cron.js /usr/local/bin/generate_cron.js + + + +COPY utils/enable_apache_mods.js /usr/local/bin/enable_apache_mods.js +COPY utils/apache-expose-envvars.sh /usr/local/bin/apache-expose-envvars.sh + +# Let's register a servername to remove the message "apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message" +RUN echo "ServerName localhost" > /etc/apache2/conf-available/servername.conf +RUN a2enconf servername + +EXPOSE 80 + +# |-------------------------------------------------------------------------- +# | Apache user +# |-------------------------------------------------------------------------- +# | +# | Defines Apache user. By default, we switch this to "docker" user. +# | This way, no problem to write from Apache in the current working directory. +# | Important! This should be changed back to www-data in production. +# | + +ENV APACHE_RUN_USER=docker \ + APACHE_RUN_GROUP=docker + +COPY utils/apache2-foreground /usr/local/bin/ +CMD ["apache2-foreground"] + + + +# Let's install the build tools (useful for node-gyp) +RUN apt-get update &&\ + apt-get install -y --no-install-recommends build-essential + + +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] + + +USER docker diff --git a/Dockerfile.26-bullseye b/Dockerfile.26-bullseye index 6e234f7..fe8d688 100644 --- a/Dockerfile.26-bullseye +++ b/Dockerfile.26-bullseye @@ -1,4 +1,4 @@ -# DO NOT EDIT THIS FILE : Make yours changes in /utils/Dockerfile.blueprint) +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) FROM debian:bullseye-slim LABEL authors="Julien Neuhart , David Négrier " @@ -34,7 +34,7 @@ RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0. # | Define a default user with sudo rights. # | - RUN useradd -ms /bin/bash docker && adduser docker sudo + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker # Users in the sudoers group can sudo as root without password. RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers @@ -54,7 +54,7 @@ RUN apt-get update &&\ curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_26.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list &&\ apt-get update &&\ - apt-get install -y --no-install-recommends nodejs&& \ + apt-get install -y --no-install-recommends nodejs && \ npm install -g corepack@latest # |-------------------------------------------------------------------------- diff --git a/Dockerfile.26-bullseye-build b/Dockerfile.26-bullseye-build index ebeb6b1..fcef6be 100644 --- a/Dockerfile.26-bullseye-build +++ b/Dockerfile.26-bullseye-build @@ -1,4 +1,4 @@ -# DO NOT EDIT THIS FILE : Make yours changes in /utils/Dockerfile.blueprint) +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) FROM debian:bullseye-slim LABEL authors="Julien Neuhart , David Négrier " @@ -34,7 +34,7 @@ RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0. # | Define a default user with sudo rights. # | - RUN useradd -ms /bin/bash docker && adduser docker sudo + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker # Users in the sudoers group can sudo as root without password. RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers @@ -54,7 +54,7 @@ RUN apt-get update &&\ curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_26.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list &&\ apt-get update &&\ - apt-get install -y --no-install-recommends nodejs&& \ + apt-get install -y --no-install-recommends nodejs && \ npm install -g corepack@latest # |-------------------------------------------------------------------------- diff --git a/Dockerfile.26-trixie b/Dockerfile.26-trixie new file mode 100644 index 0000000..31cab79 --- /dev/null +++ b/Dockerfile.26-trixie @@ -0,0 +1,134 @@ +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) +FROM debian:trixie-slim + +LABEL authors="Julien Neuhart , David Négrier " + +# |-------------------------------------------------------------------------- +# | Required libraries +# |-------------------------------------------------------------------------- +# | +# | Installs required libraries. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends curl git nano sudo ca-certificates procps libfontconfig tini --no-install-recommends + +# |-------------------------------------------------------------------------- +# | Supercronic +# |-------------------------------------------------------------------------- +# | +# | Supercronic is a drop-in replacement for cron (for containers). +# | + +RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.12/supercronic-linux-$( dpkg --print-architecture ) \ + && SUPERCRONIC=supercronic-linux-$( dpkg --print-architecture ) \ + && curl -fsSLO "$SUPERCRONIC_URL" \ + && chmod +x "$SUPERCRONIC" \ + && mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \ + && ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic + + # |-------------------------------------------------------------------------- + # | User + # |-------------------------------------------------------------------------- + # | + # | Define a default user with sudo rights. + # | + + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker + # Users in the sudoers group can sudo as root without password. + RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + + + + +# |-------------------------------------------------------------------------- +# | NodeJS +# |-------------------------------------------------------------------------- +# | +# | Installs NodeJS and npm. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends gnupg &&\ + mkdir -p /etc/apt/keyrings && \ + curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ + echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_26.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list &&\ + apt-get update &&\ + apt-get install -y --no-install-recommends nodejs && \ + npm install -g corepack@latest + +# |-------------------------------------------------------------------------- +# | yarn +# |-------------------------------------------------------------------------- +# | +# | Installs yarn. It provides some nice improvements over npm. +# | + +RUN corepack enable && corepack prepare yarn@stable --activate + +# |-------------------------------------------------------------------------- +# | PATH updating +# |-------------------------------------------------------------------------- +# | +# | Let's add ./node_modules/.bin to the PATH (utility function to use NPM bin easily) +# | + +ENV PATH="$PATH:./node_modules/.bin" +RUN sed -i 's#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:./node_modules/.bin#g' /etc/sudoers + +USER docker +# |-------------------------------------------------------------------------- +# | SSH client +# |-------------------------------------------------------------------------- +# | +# | Let's set-up the SSH client (for connections to private git repositories) +# | We create an empty known_host file and we launch the ssh-agent +# | + +RUN mkdir ~/.ssh && touch ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts && eval $(ssh-agent -s) + +# |-------------------------------------------------------------------------- +# | .bashrc updating +# |-------------------------------------------------------------------------- +# | +# | Let's update the .bashrc to add nice aliases +# | +RUN { \ + echo "alias ls='ls --color=auto'"; \ + echo "alias ll='ls --color=auto -alF'"; \ + echo "alias la='ls --color=auto -A'"; \ + echo "alias l='ls --color=auto -CF'"; \ + } >> ~/.bashrc + +USER root + +# |-------------------------------------------------------------------------- +# | Entrypoint +# |-------------------------------------------------------------------------- +# | +# | Defines the entrypoint. +# | + +ENV NODE_VERSION=26.x + + +RUN mkdir -p /usr/src/app && chown docker:docker /usr/src/app +WORKDIR /usr/src/app + + +COPY utils/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh +COPY utils/docker-entrypoint-as-root.sh /usr/local/bin/docker-entrypoint-as-root.sh +COPY utils/startup_commands.js /usr/local/bin/startup_commands.js +COPY utils/generate_cron.js /usr/local/bin/generate_cron.js + + + +CMD [ "node" ] + + + + +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] + + +USER docker diff --git a/Dockerfile.26-trixie-build b/Dockerfile.26-trixie-build new file mode 100644 index 0000000..995aed9 --- /dev/null +++ b/Dockerfile.26-trixie-build @@ -0,0 +1,138 @@ +# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint) +FROM debian:trixie-slim + +LABEL authors="Julien Neuhart , David Négrier " + +# |-------------------------------------------------------------------------- +# | Required libraries +# |-------------------------------------------------------------------------- +# | +# | Installs required libraries. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends curl git nano sudo ca-certificates procps libfontconfig tini --no-install-recommends + +# |-------------------------------------------------------------------------- +# | Supercronic +# |-------------------------------------------------------------------------- +# | +# | Supercronic is a drop-in replacement for cron (for containers). +# | + +RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.12/supercronic-linux-$( dpkg --print-architecture ) \ + && SUPERCRONIC=supercronic-linux-$( dpkg --print-architecture ) \ + && curl -fsSLO "$SUPERCRONIC_URL" \ + && chmod +x "$SUPERCRONIC" \ + && mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \ + && ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic + + # |-------------------------------------------------------------------------- + # | User + # |-------------------------------------------------------------------------- + # | + # | Define a default user with sudo rights. + # | + + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker + # Users in the sudoers group can sudo as root without password. + RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + + + + +# |-------------------------------------------------------------------------- +# | NodeJS +# |-------------------------------------------------------------------------- +# | +# | Installs NodeJS and npm. +# | + +RUN apt-get update &&\ + apt-get install -y --no-install-recommends gnupg &&\ + mkdir -p /etc/apt/keyrings && \ + curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ + echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_26.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list &&\ + apt-get update &&\ + apt-get install -y --no-install-recommends nodejs && \ + npm install -g corepack@latest + +# |-------------------------------------------------------------------------- +# | yarn +# |-------------------------------------------------------------------------- +# | +# | Installs yarn. It provides some nice improvements over npm. +# | + +RUN corepack enable && corepack prepare yarn@stable --activate + +# |-------------------------------------------------------------------------- +# | PATH updating +# |-------------------------------------------------------------------------- +# | +# | Let's add ./node_modules/.bin to the PATH (utility function to use NPM bin easily) +# | + +ENV PATH="$PATH:./node_modules/.bin" +RUN sed -i 's#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:./node_modules/.bin#g' /etc/sudoers + +USER docker +# |-------------------------------------------------------------------------- +# | SSH client +# |-------------------------------------------------------------------------- +# | +# | Let's set-up the SSH client (for connections to private git repositories) +# | We create an empty known_host file and we launch the ssh-agent +# | + +RUN mkdir ~/.ssh && touch ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts && eval $(ssh-agent -s) + +# |-------------------------------------------------------------------------- +# | .bashrc updating +# |-------------------------------------------------------------------------- +# | +# | Let's update the .bashrc to add nice aliases +# | +RUN { \ + echo "alias ls='ls --color=auto'"; \ + echo "alias ll='ls --color=auto -alF'"; \ + echo "alias la='ls --color=auto -A'"; \ + echo "alias l='ls --color=auto -CF'"; \ + } >> ~/.bashrc + +USER root + +# |-------------------------------------------------------------------------- +# | Entrypoint +# |-------------------------------------------------------------------------- +# | +# | Defines the entrypoint. +# | + +ENV NODE_VERSION=26.x + + +RUN mkdir -p /usr/src/app && chown docker:docker /usr/src/app +WORKDIR /usr/src/app + + +COPY utils/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh +COPY utils/docker-entrypoint-as-root.sh /usr/local/bin/docker-entrypoint-as-root.sh +COPY utils/startup_commands.js /usr/local/bin/startup_commands.js +COPY utils/generate_cron.js /usr/local/bin/generate_cron.js + + + +CMD [ "node" ] + + + +# Let's install the build tools (useful for node-gyp) +RUN apt-get update &&\ + apt-get install -y --no-install-recommends build-essential + + +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] + + +USER docker diff --git a/README.md b/README.md index 7403355..7451a3d 100644 --- a/README.md +++ b/README.md @@ -3,17 +3,33 @@ # General purpose NodeJS images for Docker This repository contains a set of **fat**, developer-friendly, general purpose NodeJS images for Docker. - + + - 2 distributions available: Debian `bullseye` and Debian `trixie` - 2 variants available: `standalone` and `apache` (for serving an SPA without NodeJS server as backend) - For each variant, you can select the `build` sub-variant that contains essential build tools (make, gcc, etc.) that can be needed to compile native extensions - Images are bundled with cron. Cron jobs can be configured using environment variables - Everything is done to limit file permission issues that often arise when using Docker. The image is actively tested on Linux, Windows and MacOS - - Base image is Debian Bullseye (with more variants to come) ## Images | Name | NodeJs version | variant | build tools | base distro | |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------|------------|-------------|-----------------| +| [thecodingmachine/nodejs:v2-20-trixie](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.20-trixie)
[ghcr.io/thecodingmachine/nodejs:v2-20-trixie](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.20-trixie) | `20.x` | standalone | No | Debian Trixie | +| [thecodingmachine/nodejs:v2-22-trixie](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.22-trixie)
[ghcr.io/thecodingmachine/nodejs:v2-22-trixie](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.22-trixie) | `22.x` | standalone | No | Debian Trixie | +| [thecodingmachine/nodejs:v2-24-trixie](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.24-trixie)
[ghcr.io/thecodingmachine/nodejs:v2-24-trixie](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.24-trixie) | `24.x` | standalone | No | Debian Trixie | +| [thecodingmachine/nodejs:v2-26-trixie](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.26-trixie)
[ghcr.io/thecodingmachine/nodejs:v2-26-trixie](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.26-trixie) | `26.x` | standalone | No | Debian Trixie | +| [thecodingmachine/nodejs:v2-20-trixie-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.20-trixie-build)
[ghcr.io/thecodingmachine/nodejs:v2-20-trixie-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.20-trixie-build) | `20.x` | standalone | Yes | Debian Trixie | +| [thecodingmachine/nodejs:v2-22-trixie-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.22-trixie-build)
[ghcr.io/thecodingmachine/nodejs:v2-22-trixie-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.22-trixie-build) | `22.x` | standalone | Yes | Debian Trixie | +| [thecodingmachine/nodejs:v2-24-trixie-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.24-trixie-build)
[ghcr.io/thecodingmachine/nodejs:v2-24-trixie-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.24-trixie-build) | `24.x` | standalone | Yes | Debian Trixie | +| [thecodingmachine/nodejs:v2-26-trixie-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.26-trixie-build)
[ghcr.io/thecodingmachine/nodejs:v2-26-trixie-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.26-trixie-build) | `26.x` | standalone | Yes | Debian Trixie | +| [thecodingmachine/nodejs:v2-20-apache-trixie](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.20-apache-trixie)
[ghcr.io/thecodingmachine/nodejs:v2-20-apache-trixie](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.20-apache-trixie) | `20.x` | apache | No | Debian Trixie | +| [thecodingmachine/nodejs:v2-22-apache-trixie](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.22-apache-trixie)
[ghcr.io/thecodingmachine/nodejs:v2-22-apache-trixie](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.22-apache-trixie) | `22.x` | apache | No | Debian Trixie | +| [thecodingmachine/nodejs:v2-24-apache-trixie](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.24-apache-trixie)
[ghcr.io/thecodingmachine/nodejs:v2-24-apache-trixie](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.24-apache-trixie) | `24.x` | apache | No | Debian Trixie | +| [thecodingmachine/nodejs:v2-26-apache-trixie](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.26-apache-trixie)
[ghcr.io/thecodingmachine/nodejs:v2-26-apache-trixie](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.26-apache-trixie) | `26.x` | apache | No | Debian Trixie | +| [thecodingmachine/nodejs:v2-20-apache-trixie-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.20-apache-trixie-build)
[ghcr.io/thecodingmachine/nodejs:v2-20-apache-trixie-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.20-apache-trixie-build) | `20.x` | apache | Yes | Debian Trixie | +| [thecodingmachine/nodejs:v2-22-apache-trixie-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.22-apache-trixie-build)
[ghcr.io/thecodingmachine/nodejs:v2-22-apache-trixie-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.22-apache-trixie-build) | `22.x` | apache | Yes | Debian Trixie | +| [thecodingmachine/nodejs:v2-24-apache-trixie-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.24-apache-trixie-build)
[ghcr.io/thecodingmachine/nodejs:v2-24-apache-trixie-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.24-apache-trixie-build) | `24.x` | apache | Yes | Debian Trixie | +| [thecodingmachine/nodejs:v2-26-apache-trixie-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.26-apache-trixie-build)
[ghcr.io/thecodingmachine/nodejs:v2-26-apache-trixie-build](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.26-apache-trixie-build) | `26.x` | apache | Yes | Debian Trixie | | [thecodingmachine/nodejs:v2-16-bullseye](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.16-bullseye)
[ghcr.io/thecodingmachine/nodejs:v2-16-bullseye](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.16-bullseye) | `16.x` | standalone | No | Debian Bullseye | | [thecodingmachine/nodejs:v2-18-bullseye](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.18-bullseye)
[ghcr.io/thecodingmachine/nodejs:v2-18-bullseye](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.18-bullseye) | `18.x` | standalone | No | Debian Bullseye | | [thecodingmachine/nodejs:v2-20-bullseye](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.20-bullseye)
[ghcr.io/thecodingmachine/nodejs:v2-20-bullseye](https://github.com/thecodingmachine/docker-images-nodejs/blob/master/Dockerfile.20-bullseye) | `20.x` | standalone | No | Debian Bullseye | diff --git a/orbit.yml b/orbit.yml index 4c61ef0..e9c013e 100644 --- a/orbit.yml +++ b/orbit.yml @@ -43,5 +43,21 @@ tasks: - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.22-apache-bullseye-build -p "NodeVersion,22;Variant,apache;BaseImage,debian:bullseye-slim;Build,true" - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.24-apache-bullseye-build -p "NodeVersion,24;Variant,apache;BaseImage,debian:bullseye-slim;Build,true" - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.26-apache-bullseye-build -p "NodeVersion,26;Variant,apache;BaseImage,debian:bullseye-slim;Build,true" + - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.20-trixie -p "NodeVersion,20;Variant,standalone;BaseImage,debian:trixie-slim;Build,false" + - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.22-trixie -p "NodeVersion,22;Variant,standalone;BaseImage,debian:trixie-slim;Build,false" + - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.24-trixie -p "NodeVersion,24;Variant,standalone;BaseImage,debian:trixie-slim;Build,false" + - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.26-trixie -p "NodeVersion,26;Variant,standalone;BaseImage,debian:trixie-slim;Build,false" + - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.20-apache-trixie -p "NodeVersion,20;Variant,apache;BaseImage,debian:trixie-slim;Build,false" + - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.22-apache-trixie -p "NodeVersion,22;Variant,apache;BaseImage,debian:trixie-slim;Build,false" + - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.24-apache-trixie -p "NodeVersion,24;Variant,apache;BaseImage,debian:trixie-slim;Build,false" + - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.26-apache-trixie -p "NodeVersion,26;Variant,apache;BaseImage,debian:trixie-slim;Build,false" + - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.20-trixie-build -p "NodeVersion,20;Variant,standalone;BaseImage,debian:trixie-slim;Build,true" + - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.22-trixie-build -p "NodeVersion,22;Variant,standalone;BaseImage,debian:trixie-slim;Build,true" + - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.24-trixie-build -p "NodeVersion,24;Variant,standalone;BaseImage,debian:trixie-slim;Build,true" + - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.26-trixie-build -p "NodeVersion,26;Variant,standalone;BaseImage,debian:trixie-slim;Build,true" + - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.20-apache-trixie-build -p "NodeVersion,20;Variant,apache;BaseImage,debian:trixie-slim;Build,true" + - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.22-apache-trixie-build -p "NodeVersion,22;Variant,apache;BaseImage,debian:trixie-slim;Build,true" + - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.24-apache-trixie-build -p "NodeVersion,24;Variant,apache;BaseImage,debian:trixie-slim;Build,true" + - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.26-apache-trixie-build -p "NodeVersion,26;Variant,apache;BaseImage,debian:trixie-slim;Build,true" - |- - sed -i '1i\# DO NOT EDIT THIS FILE : Make yours changes in /utils/Dockerfile.blueprint)' Dockerfile.* + sed -i '1i\# DO NOT EDIT THIS FILE : Make your changes in /utils/Dockerfile.blueprint)' Dockerfile.* diff --git a/utils/Dockerfile.blueprint b/utils/Dockerfile.blueprint index 478e6e2..851a3d8 100644 --- a/utils/Dockerfile.blueprint +++ b/utils/Dockerfile.blueprint @@ -38,7 +38,7 @@ RUN SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0. # | Define a default user with sudo rights. # | - RUN useradd -ms /bin/bash docker && adduser docker sudo + RUN useradd -ms /bin/bash docker && usermod -a -G sudo docker # Users in the sudoers group can sudo as root without password. RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers @@ -128,7 +128,7 @@ RUN apt-get update &&\ curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_{{ $node_version }}.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list &&\{{ end }} apt-get update &&\ - apt-get install -y --no-install-recommends nodejs{{ if ge $node_version "26" }}&& \ + apt-get install -y --no-install-recommends nodejs{{ if ge $node_version "26" }} && \ npm install -g corepack@latest{{ end }} # |--------------------------------------------------------------------------