Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fa00a25d4d | |||
| 547902d7dc | |||
| 9dec627696 | |||
| 3aa0882bcd | |||
| 39a635be23 | |||
| 59aa098bbb | |||
| e60d3a64a2 | |||
| 1d40374b43 | |||
| 3513318194 | |||
| ae95abd4df | |||
| fd4ef9ef54 | |||
| c8088a5103 | |||
| c4f2c3b9c5 | |||
| 9b84e0b72c | |||
| c107a02c8a | |||
| 667716ae2d | |||
| 20ef9c9a48 | |||
| 61a7c1cc7d | |||
| 5743898ba7 | |||
| c3847a970e | |||
| 2a7eb157b6 | |||
| 74c7bcd053 | |||
| e61aeaad2d | |||
| e1ad8c2d83 | |||
| 9aed8b7b40 | |||
| 165712267c | |||
| 391b13bf57 |
14
.dockerignore
Normal file
14
.dockerignore
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
.git
|
||||||
|
.nogit
|
||||||
|
node_modules
|
||||||
|
dist
|
||||||
|
dist_*
|
||||||
|
coverage
|
||||||
|
public
|
||||||
|
pages
|
||||||
|
.yarn
|
||||||
|
.cache
|
||||||
|
.rpt2_cache
|
||||||
|
*.md
|
||||||
|
!image_support_files/**
|
||||||
|
test
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
name: Docker (tags)
|
name: Docker (non-tag pushes)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -6,7 +6,7 @@ on:
|
|||||||
- '**'
|
- '**'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
IMAGE: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
IMAGE: registry.gitlab.com/hosttoday/ht-docker-node:szci
|
||||||
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@gitea.lossless.digital/${{gitea.repository}}.git
|
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@gitea.lossless.digital/${{gitea.repository}}.git
|
||||||
NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}}
|
NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}}
|
||||||
NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
|
NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
|
||||||
@@ -24,22 +24,22 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install pnpm and npmci
|
- name: Install pnpm and szci
|
||||||
run: |
|
run: |
|
||||||
pnpm install -g pnpm
|
pnpm install -g pnpm
|
||||||
pnpm install -g @ship.zone/npmci
|
pnpm install -g @ship.zone/szci
|
||||||
npmci npm prepare
|
szci npm prepare
|
||||||
|
|
||||||
- name: Audit production dependencies
|
- name: Audit production dependencies
|
||||||
run: |
|
run: |
|
||||||
npmci command npm config set registry https://registry.npmjs.org
|
szci command npm config set registry https://registry.npmjs.org
|
||||||
npmci command pnpm audit --audit-level=high --prod
|
szci command pnpm audit --audit-level=high --prod
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
- name: Audit development dependencies
|
- name: Audit development dependencies
|
||||||
run: |
|
run: |
|
||||||
npmci command npm config set registry https://registry.npmjs.org
|
szci command npm config set registry https://registry.npmjs.org
|
||||||
npmci command pnpm audit --audit-level=high --dev
|
szci command pnpm audit --audit-level=high --dev
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
test:
|
test:
|
||||||
@@ -54,18 +54,18 @@ jobs:
|
|||||||
- name: Prepare
|
- name: Prepare
|
||||||
run: |
|
run: |
|
||||||
pnpm install -g pnpm
|
pnpm install -g pnpm
|
||||||
pnpm install -g @ship.zone/npmci
|
pnpm install -g @ship.zone/szci
|
||||||
npmci npm prepare
|
szci npm prepare
|
||||||
|
|
||||||
- name: Test stable
|
- name: Test stable
|
||||||
run: |
|
run: |
|
||||||
npmci node install stable
|
szci node install stable
|
||||||
npmci npm install
|
szci npm install
|
||||||
npmci npm test
|
szci npm test
|
||||||
|
|
||||||
- name: Test build
|
- name: Test build
|
||||||
run: |
|
run: |
|
||||||
npmci npm prepare
|
szci npm prepare
|
||||||
npmci node install stable
|
szci node install stable
|
||||||
npmci npm install
|
szci npm install
|
||||||
npmci command npm run build
|
szci command npm run build
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ on:
|
|||||||
- '*'
|
- '*'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
IMAGE: code.foss.global/host.today/ht-docker-node:npmci
|
IMAGE: code.foss.global/host.today/ht-docker-node:szci
|
||||||
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@gitea.lossless.digital/${{gitea.repository}}.git
|
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@gitea.lossless.digital/${{gitea.repository}}.git
|
||||||
# NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}}
|
# NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}}
|
||||||
# NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
|
# NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
|
||||||
@@ -27,19 +27,19 @@ jobs:
|
|||||||
- name: Prepare
|
- name: Prepare
|
||||||
run: |
|
run: |
|
||||||
pnpm install -g pnpm
|
pnpm install -g pnpm
|
||||||
pnpm install -g @ship.zone/npmci
|
pnpm install -g @ship.zone/szci
|
||||||
npmci npm prepare
|
szci npm prepare
|
||||||
|
|
||||||
- name: Audit production dependencies
|
- name: Audit production dependencies
|
||||||
run: |
|
run: |
|
||||||
npmci command npm config set registry https://registry.npmjs.org
|
szci command npm config set registry https://registry.npmjs.org
|
||||||
npmci command pnpm audit --audit-level=high --prod
|
szci command pnpm audit --audit-level=high --prod
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
- name: Audit development dependencies
|
- name: Audit development dependencies
|
||||||
run: |
|
run: |
|
||||||
npmci command npm config set registry https://registry.npmjs.org
|
szci command npm config set registry https://registry.npmjs.org
|
||||||
npmci command pnpm audit --audit-level=high --dev
|
szci command pnpm audit --audit-level=high --dev
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
test:
|
test:
|
||||||
@@ -54,27 +54,27 @@ jobs:
|
|||||||
- name: Prepare
|
- name: Prepare
|
||||||
run: |
|
run: |
|
||||||
pnpm install -g pnpm
|
pnpm install -g pnpm
|
||||||
pnpm install -g @ship.zone/npmci
|
pnpm install -g @ship.zone/szci
|
||||||
npmci npm prepare
|
szci npm prepare
|
||||||
|
|
||||||
- name: Test stable
|
- name: Test stable
|
||||||
run: |
|
run: |
|
||||||
npmci node install stable
|
szci node install stable
|
||||||
npmci npm install
|
szci npm install
|
||||||
npmci npm test
|
szci npm test
|
||||||
|
|
||||||
- name: Test build
|
- name: Test build
|
||||||
run: |
|
run: |
|
||||||
npmci node install stable
|
szci node install stable
|
||||||
npmci npm install
|
szci npm install
|
||||||
npmci command npm run build
|
szci command npm run build
|
||||||
|
|
||||||
release:
|
release:
|
||||||
needs: test
|
needs: test
|
||||||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
|
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: code.foss.global/host.today/ht-docker-dbase:npmci
|
image: code.foss.global/host.today/ht-docker-dbase:szci
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
@@ -82,15 +82,22 @@ jobs:
|
|||||||
- name: Prepare
|
- name: Prepare
|
||||||
run: |
|
run: |
|
||||||
pnpm install -g pnpm
|
pnpm install -g pnpm
|
||||||
pnpm install -g @ship.zone/npmci
|
pnpm install -g @git.zone/tsdocker@latest
|
||||||
|
|
||||||
- name: Release
|
- name: Login to registries
|
||||||
run: |
|
run: tsdocker login
|
||||||
npmci docker login
|
|
||||||
npmci docker build
|
- name: List discovered Dockerfiles
|
||||||
npmci docker test
|
run: tsdocker list
|
||||||
# npmci docker push gitea.lossless.digital
|
|
||||||
npmci docker push code.foss.global
|
- name: Build all images
|
||||||
|
run: tsdocker build
|
||||||
|
|
||||||
|
- name: Test images
|
||||||
|
run: tsdocker test
|
||||||
|
|
||||||
|
- name: Push to code.foss.global
|
||||||
|
run: tsdocker push code.foss.global
|
||||||
|
|
||||||
metadata:
|
metadata:
|
||||||
needs: test
|
needs: test
|
||||||
@@ -103,4 +110,4 @@ jobs:
|
|||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Trigger
|
- name: Trigger
|
||||||
run: npmci trigger
|
run: szci trigger
|
||||||
|
|||||||
75
Dockerfile
75
Dockerfile
@@ -1,45 +1,53 @@
|
|||||||
FROM ubuntu:20.04
|
FROM ubuntu:24.04
|
||||||
LABEL author="Task Venture Capital GmbH <hello@task.vc>"
|
LABEL author="Task Venture Capital GmbH <hello@task.vc>"
|
||||||
|
|
||||||
WORKDIR /workspace
|
WORKDIR /workspace
|
||||||
# important environment variables
|
# important environment variables
|
||||||
ENV NODE_VERSION_LTS="20.12.2" NODE_VERSION_STABLE="20.12.2" NVM_DIR="/usr/local/nvm"
|
ENV NODE_VERSION_LTS="24.13.0" NODE_VERSION_STABLE="24.13.0" NVM_DIR="/usr/local/nvm"
|
||||||
|
|
||||||
# Set debconf to run non-interactively and install packages
|
# Chromium paths for Puppeteer/Playwright compatibility
|
||||||
|
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
|
||||||
|
ENV CHROME_BIN=/usr/bin/chromium-browser
|
||||||
|
|
||||||
|
# Layer 1: Base system + dev tools
|
||||||
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections \
|
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections \
|
||||||
&& apt-get update \
|
&& apt-get update \
|
||||||
&& apt-get upgrade --no-install-recommends -y \
|
&& apt-get upgrade --no-install-recommends -y \
|
||||||
&& apt-get install -y -q --no-install-recommends \
|
&& apt-get install -y -q --no-install-recommends \
|
||||||
# base libs
|
|
||||||
software-properties-common \
|
software-properties-common \
|
||||||
apt-transport-https \
|
apt-transport-https \
|
||||||
build-essential \
|
build-essential \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
gpg-agent \
|
gpg-agent \
|
||||||
curl \
|
curl \
|
||||||
g++ \
|
|
||||||
gcc \
|
|
||||||
git \
|
git \
|
||||||
make \
|
|
||||||
openssl \
|
openssl \
|
||||||
python \
|
|
||||||
python3 \
|
python3 \
|
||||||
rsync \
|
rsync \
|
||||||
ssh \
|
ssh \
|
||||||
wget \
|
wget \
|
||||||
unzip \
|
unzip \
|
||||||
# puppeteer
|
jq \
|
||||||
gconf-service \
|
iputils-ping \
|
||||||
libasound2 \
|
dnsutils \
|
||||||
|
tini \
|
||||||
|
gcc-aarch64-linux-gnu \
|
||||||
|
&& apt-get clean
|
||||||
|
|
||||||
|
# Layer 2: Chromium + Puppeteer/Playwright browser deps
|
||||||
|
RUN apt-get install -y -q --no-install-recommends \
|
||||||
|
chromium-browser \
|
||||||
|
libasound2t64 \
|
||||||
libatk1.0-0 \
|
libatk1.0-0 \
|
||||||
|
libatk-bridge2.0-0 \
|
||||||
libc6 \
|
libc6 \
|
||||||
libcairo2 \
|
libcairo2 \
|
||||||
libcups2 \
|
libcups2 \
|
||||||
libdbus-1-3 \
|
libdbus-1-3 \
|
||||||
libexpat1 \
|
libexpat1 \
|
||||||
libfontconfig1 \
|
libfontconfig1 \
|
||||||
libgcc1 \
|
libgbm1 \
|
||||||
libgconf-2-4 \
|
libgcc-s1 \
|
||||||
libgdk-pixbuf2.0-0 \
|
libgdk-pixbuf2.0-0 \
|
||||||
libglib2.0-0 \
|
libglib2.0-0 \
|
||||||
libgtk-3-0 \
|
libgtk-3-0 \
|
||||||
@@ -60,31 +68,26 @@ RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selectio
|
|||||||
libxrender1 \
|
libxrender1 \
|
||||||
libxss1 \
|
libxss1 \
|
||||||
libxtst6 \
|
libxtst6 \
|
||||||
ca-certificates \
|
|
||||||
fonts-liberation \
|
fonts-liberation \
|
||||||
libappindicator1 \
|
libayatana-appindicator3-1 \
|
||||||
libnss3 \
|
libnss3 \
|
||||||
lsb-release \
|
lsb-release \
|
||||||
xdg-utils \
|
xdg-utils \
|
||||||
# network
|
|
||||||
iputils-ping \
|
|
||||||
dnsutils \
|
|
||||||
|
|
||||||
# chrome
|
|
||||||
&& wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
|
|
||||||
&& apt install -y -q --no-install-recommends ./google-chrome-stable_current_amd64.deb \
|
|
||||||
|
|
||||||
# mongodb
|
|
||||||
&& curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | apt-key add - \
|
|
||||||
&& echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-4.4.list \
|
|
||||||
&& apt-get update \
|
|
||||||
&& apt-get install -y -q --no-install-recommends \
|
|
||||||
mongodb-org \
|
|
||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
&& rm -r /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Layer 3: MongoDB 8.0
|
||||||
|
RUN curl -fsSL https://www.mongodb.org/static/pgp/server-8.0.asc | \
|
||||||
|
gpg --dearmor -o /usr/share/keyrings/mongodb-server-8.0.gpg \
|
||||||
|
&& echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/ubuntu noble/mongodb-org/8.0 multiverse" | \
|
||||||
|
tee /etc/apt/sources.list.d/mongodb-org-8.0.list \
|
||||||
|
&& apt-get update \
|
||||||
|
&& apt-get install -y -q --no-install-recommends mongodb-org \
|
||||||
|
&& apt-get clean \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Install nvm with node and npm
|
# Install nvm with node and npm
|
||||||
RUN curl https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
|
RUN mkdir -p $NVM_DIR && curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
|
||||||
|
|
||||||
# Make nvm available globally in all bash shells (interactive + non-interactive)
|
# Make nvm available globally in all bash shells (interactive + non-interactive)
|
||||||
# IMPORTANT: Prepend to bashrc, before the "[ -z "$PS1" ] && return" line
|
# IMPORTANT: Prepend to bashrc, before the "[ -z "$PS1" ] && return" line
|
||||||
@@ -118,7 +121,7 @@ RUN nvm install $NODE_VERSION_STABLE \
|
|||||||
&& pnpm -v \
|
&& pnpm -v \
|
||||||
&& pnpm config set unsafe-perm true
|
&& pnpm config set unsafe-perm true
|
||||||
|
|
||||||
ENV NODE_PATH $NVM_DIR/v$NODE_VERSION_STABLE/lib/node_modules
|
ENV NODE_PATH $NVM_DIR/versions/node/v$NODE_VERSION_STABLE/lib/node_modules
|
||||||
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION_STABLE/bin:$PATH
|
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION_STABLE/bin:$PATH
|
||||||
|
|
||||||
# Install Bun
|
# Install Bun
|
||||||
@@ -131,6 +134,12 @@ RUN curl -fsSL https://deno.land/install.sh | sh
|
|||||||
ENV DENO_INSTALL="/root/.deno"
|
ENV DENO_INSTALL="/root/.deno"
|
||||||
ENV PATH="$DENO_INSTALL/bin:$PATH"
|
ENV PATH="$DENO_INSTALL/bin:$PATH"
|
||||||
|
|
||||||
|
# Install Rust
|
||||||
|
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
|
||||||
|
&& . /root/.cargo/env \
|
||||||
|
&& rustup target add aarch64-unknown-linux-gnu
|
||||||
|
ENV PATH="/root/.cargo/bin:$PATH"
|
||||||
|
|
||||||
# Set entrypoint to make nvm available in all runtime contexts
|
# Set entrypoint to make nvm available in all runtime contexts
|
||||||
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|
ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/docker-entrypoint.sh"]
|
||||||
CMD ["bash"]
|
CMD ["bash"]
|
||||||
|
|||||||
@@ -4,9 +4,8 @@ LABEL author="Task Venture Capital GmbH <hello@task.vc>"
|
|||||||
WORKDIR /workspace
|
WORKDIR /workspace
|
||||||
|
|
||||||
# Important environment variables
|
# Important environment variables
|
||||||
ENV NODE_VERSION_LTS="20.18.2" \
|
ENV NODE_VERSION_LTS="24.13.0" \
|
||||||
NVM_DIR="/usr/local/nvm" \
|
NVM_DIR="/usr/local/nvm" \
|
||||||
PNPM_HOME="/root/.local/share/pnpm" \
|
|
||||||
NVM_NODEJS_ORG_MIRROR="https://unofficial-builds.nodejs.org/download/release"
|
NVM_NODEJS_ORG_MIRROR="https://unofficial-builds.nodejs.org/download/release"
|
||||||
|
|
||||||
# Install required packages for NVM and Node.js
|
# Install required packages for NVM and Node.js
|
||||||
@@ -14,18 +13,14 @@ RUN apk add --no-cache \
|
|||||||
bash \
|
bash \
|
||||||
curl \
|
curl \
|
||||||
git \
|
git \
|
||||||
build-base \
|
|
||||||
python3 \
|
|
||||||
linux-headers \
|
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
wget \
|
|
||||||
unzip \
|
unzip \
|
||||||
iputils \
|
gcompat \
|
||||||
bind-tools \
|
libstdc++ \
|
||||||
libstdc++
|
tini
|
||||||
|
|
||||||
# Install NVM (latest version for better Alpine/musl support)
|
# Install NVM (latest version for better Alpine/musl support)
|
||||||
RUN mkdir -p $NVM_DIR && curl https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
|
RUN mkdir -p $NVM_DIR && curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
|
||||||
|
|
||||||
# Make nvm available globally in all bash shells (interactive + non-interactive)
|
# Make nvm available globally in all bash shells (interactive + non-interactive)
|
||||||
# IMPORTANT: Create /etc/bash.bashrc with nvm initialization
|
# IMPORTANT: Create /etc/bash.bashrc with nvm initialization
|
||||||
@@ -46,22 +41,21 @@ SHELL ["/usr/local/bin/bash-with-nvm"]
|
|||||||
# Enable nvm for runtime bash commands (CI/CD workflows)
|
# Enable nvm for runtime bash commands (CI/CD workflows)
|
||||||
ENV BASH_ENV=/etc/bash.bashrc
|
ENV BASH_ENV=/etc/bash.bashrc
|
||||||
|
|
||||||
# Prepare pnpm directory
|
# Install Node.js LTS via NVM
|
||||||
RUN mkdir -p ${PNPM_HOME}
|
|
||||||
ENV PATH="$PNPM_HOME:$PATH"
|
|
||||||
|
|
||||||
# Install Node.js LTS via NVM and pnpm
|
|
||||||
# Use musl-specific builds from unofficial-builds for Alpine compatibility
|
# Use musl-specific builds from unofficial-builds for Alpine compatibility
|
||||||
RUN nvm install $NODE_VERSION_LTS \
|
# TARGETARCH fix: QEMU buildx can report wrong arch via uname -m, causing NVM
|
||||||
|
# to download x64 binaries on arm64. We override nvm_get_arch to ensure the
|
||||||
|
# correct architecture binary is downloaded.
|
||||||
|
ARG TARGETARCH
|
||||||
|
RUN NVM_MUSL_ARCH=$([ "$TARGETARCH" = "arm64" ] && echo "arm64-musl" || echo "x64-musl") \
|
||||||
|
&& nvm_get_arch() { echo "$NVM_MUSL_ARCH"; } \
|
||||||
|
&& nvm install $NODE_VERSION_LTS \
|
||||||
&& nvm alias default $NODE_VERSION_LTS \
|
&& nvm alias default $NODE_VERSION_LTS \
|
||||||
&& nvm use default \
|
&& nvm use default
|
||||||
&& npm install -g pnpm \
|
|
||||||
&& pnpm -v \
|
|
||||||
&& pnpm config set unsafe-perm true
|
|
||||||
|
|
||||||
ENV NODE_PATH=$NVM_DIR/v$NODE_VERSION_LTS/lib/node_modules
|
ENV NODE_PATH=$NVM_DIR/versions/node/v$NODE_VERSION_LTS/lib/node_modules
|
||||||
ENV PATH=$NVM_DIR/versions/node/v$NODE_VERSION_LTS/bin:$PATH
|
ENV PATH=$NVM_DIR/versions/node/v$NODE_VERSION_LTS/bin:$PATH
|
||||||
|
|
||||||
# Set entrypoint to make nvm available in all runtime contexts
|
# Set entrypoint to make nvm available in all runtime contexts
|
||||||
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|
ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/docker-entrypoint.sh"]
|
||||||
CMD ["bash"]
|
CMD ["bash"]
|
||||||
9
Dockerfile_alpine-bun
Normal file
9
Dockerfile_alpine-bun
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
FROM host.today/ht-docker-node:alpine
|
||||||
|
LABEL author="Task Venture Capital GmbH <hello@task.vc>"
|
||||||
|
|
||||||
|
ENV BUN_INSTALL="/root/.bun"
|
||||||
|
|
||||||
|
# Install Bun
|
||||||
|
RUN curl -fsSL https://bun.sh/install | bash
|
||||||
|
|
||||||
|
ENV PATH="$BUN_INSTALL/bin:$PATH"
|
||||||
9
Dockerfile_alpine-deno
Normal file
9
Dockerfile_alpine-deno
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
FROM host.today/ht-docker-node:alpine
|
||||||
|
LABEL author="Task Venture Capital GmbH <hello@task.vc>"
|
||||||
|
|
||||||
|
ENV DENO_INSTALL="/root/.deno"
|
||||||
|
|
||||||
|
# Install Deno (standard glibc binary works via gcompat in base image)
|
||||||
|
RUN curl -fsSL https://deno.land/install.sh | sh
|
||||||
|
|
||||||
|
ENV PATH="$DENO_INSTALL/bin:$PATH"
|
||||||
22
Dockerfile_alpine-node
Normal file
22
Dockerfile_alpine-node
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
FROM host.today/ht-docker-node:alpine
|
||||||
|
LABEL author="Task Venture Capital GmbH <hello@task.vc>"
|
||||||
|
|
||||||
|
ENV PNPM_HOME="/root/.local/share/pnpm"
|
||||||
|
|
||||||
|
# Install additional build tools for native modules
|
||||||
|
RUN apk add --no-cache \
|
||||||
|
build-base \
|
||||||
|
python3 \
|
||||||
|
linux-headers \
|
||||||
|
wget \
|
||||||
|
iputils \
|
||||||
|
bind-tools
|
||||||
|
|
||||||
|
# Prepare pnpm directory
|
||||||
|
RUN mkdir -p ${PNPM_HOME}
|
||||||
|
ENV PATH="$PNPM_HOME:$PATH"
|
||||||
|
|
||||||
|
# Install pnpm
|
||||||
|
RUN npm install -g pnpm \
|
||||||
|
&& pnpm -v \
|
||||||
|
&& pnpm config set unsafe-perm true
|
||||||
11
Dockerfile_alpine-szci
Normal file
11
Dockerfile_alpine-szci
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
FROM host.today/ht-docker-node:alpine-node
|
||||||
|
ENV PYTHONUNBUFFERED=1
|
||||||
|
RUN apk add --no-cache \
|
||||||
|
libc6-compat \
|
||||||
|
alpine-sdk \
|
||||||
|
python3-dev \
|
||||||
|
py3-pip \
|
||||||
|
libffi-dev \
|
||||||
|
openssl-dev \
|
||||||
|
&& ln -sf python3 /usr/bin/python \
|
||||||
|
&& pnpm install -g @ship.zone/szci node-gyp
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
FROM alpine:latest
|
|
||||||
LABEL author="Task Venture Capital GmbH <hello@task.vc>"
|
|
||||||
|
|
||||||
WORKDIR /workspace
|
|
||||||
|
|
||||||
# Important environment variables
|
|
||||||
ENV NODE_VERSION_LTS="20.18.2" \
|
|
||||||
NVM_DIR="/usr/local/nvm" \
|
|
||||||
BUN_INSTALL="/root/.bun" \
|
|
||||||
NVM_NODEJS_ORG_MIRROR="https://unofficial-builds.nodejs.org/download/release"
|
|
||||||
|
|
||||||
# Install required packages for NVM and Node.js
|
|
||||||
RUN apk add --no-cache \
|
|
||||||
bash \
|
|
||||||
curl \
|
|
||||||
git \
|
|
||||||
ca-certificates \
|
|
||||||
unzip \
|
|
||||||
libstdc++
|
|
||||||
|
|
||||||
# Install NVM (latest version for better Alpine/musl support)
|
|
||||||
RUN mkdir -p $NVM_DIR && curl https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
|
|
||||||
|
|
||||||
# Make nvm available globally in all bash shells (interactive + non-interactive)
|
|
||||||
# IMPORTANT: Create /etc/bash.bashrc with nvm initialization
|
|
||||||
RUN printf '%s\n%s\n%s\n' \
|
|
||||||
'export NVM_DIR="/usr/local/nvm"' \
|
|
||||||
'[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"' \
|
|
||||||
'[ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion"' \
|
|
||||||
> /etc/bash.bashrc
|
|
||||||
|
|
||||||
# Copy nvm wrapper scripts from support directory
|
|
||||||
COPY image_support_files/bash-with-nvm /usr/local/bin/bash-with-nvm
|
|
||||||
COPY image_support_files/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
|
||||||
RUN chmod +x /usr/local/bin/bash-with-nvm /usr/local/bin/docker-entrypoint.sh
|
|
||||||
|
|
||||||
# Use wrapper for RUN commands to enable nvm
|
|
||||||
SHELL ["/usr/local/bin/bash-with-nvm"]
|
|
||||||
|
|
||||||
# Enable nvm for runtime bash commands (CI/CD workflows)
|
|
||||||
ENV BASH_ENV=/etc/bash.bashrc
|
|
||||||
|
|
||||||
# Install Node.js LTS via NVM and Bun
|
|
||||||
RUN nvm install $NODE_VERSION_LTS \
|
|
||||||
&& nvm alias default $NODE_VERSION_LTS \
|
|
||||||
&& nvm use default \
|
|
||||||
&& curl -fsSL https://bun.sh/install | bash
|
|
||||||
|
|
||||||
ENV PATH="$BUN_INSTALL/bin:$NVM_DIR/versions/node/v$NODE_VERSION_LTS/bin:$PATH"
|
|
||||||
ENV NODE_PATH=$NVM_DIR/v$NODE_VERSION_LTS/lib/node_modules
|
|
||||||
|
|
||||||
# Set entrypoint to make nvm available in all runtime contexts
|
|
||||||
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|
|
||||||
CMD ["bash"]
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
FROM alpine:edge
|
|
||||||
LABEL author="Task Venture Capital GmbH <hello@task.vc>"
|
|
||||||
|
|
||||||
WORKDIR /workspace
|
|
||||||
|
|
||||||
# Important environment variables
|
|
||||||
ENV NODE_VERSION_LTS="20.18.2" \
|
|
||||||
NVM_DIR="/usr/local/nvm" \
|
|
||||||
NVM_NODEJS_ORG_MIRROR="https://unofficial-builds.nodejs.org/download/release"
|
|
||||||
|
|
||||||
# Install required packages for NVM and Node.js
|
|
||||||
# Install Deno from Alpine community repository (native musl build)
|
|
||||||
RUN apk add --no-cache \
|
|
||||||
bash \
|
|
||||||
curl \
|
|
||||||
git \
|
|
||||||
ca-certificates \
|
|
||||||
unzip \
|
|
||||||
libstdc++ \
|
|
||||||
deno
|
|
||||||
|
|
||||||
# Install NVM (latest version for better Alpine/musl support)
|
|
||||||
RUN mkdir -p $NVM_DIR && curl https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
|
|
||||||
|
|
||||||
# Make nvm available globally in all bash shells (interactive + non-interactive)
|
|
||||||
# IMPORTANT: Create /etc/bash.bashrc with nvm initialization
|
|
||||||
RUN printf '%s\n%s\n%s\n' \
|
|
||||||
'export NVM_DIR="/usr/local/nvm"' \
|
|
||||||
'[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"' \
|
|
||||||
'[ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion"' \
|
|
||||||
> /etc/bash.bashrc
|
|
||||||
|
|
||||||
# Copy nvm wrapper scripts from support directory
|
|
||||||
COPY image_support_files/bash-with-nvm /usr/local/bin/bash-with-nvm
|
|
||||||
COPY image_support_files/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
|
||||||
RUN chmod +x /usr/local/bin/bash-with-nvm /usr/local/bin/docker-entrypoint.sh
|
|
||||||
|
|
||||||
# Use wrapper for RUN commands to enable nvm
|
|
||||||
SHELL ["/usr/local/bin/bash-with-nvm"]
|
|
||||||
|
|
||||||
# Enable nvm for runtime bash commands (CI/CD workflows)
|
|
||||||
ENV BASH_ENV=/etc/bash.bashrc
|
|
||||||
|
|
||||||
# Install Node.js LTS via NVM (Deno already installed from Alpine repos)
|
|
||||||
RUN nvm install $NODE_VERSION_LTS \
|
|
||||||
&& nvm alias default $NODE_VERSION_LTS \
|
|
||||||
&& nvm use default
|
|
||||||
|
|
||||||
ENV PATH="$NVM_DIR/versions/node/v$NODE_VERSION_LTS/bin:$PATH"
|
|
||||||
ENV NODE_PATH=$NVM_DIR/v$NODE_VERSION_LTS/lib/node_modules
|
|
||||||
|
|
||||||
# Set entrypoint to make nvm available in all runtime contexts
|
|
||||||
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|
|
||||||
CMD ["bash"]
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
FROM host.today/ht-docker-node:alpine
|
|
||||||
RUN apk update && apk add bash libc6-compat alpine-sdk
|
|
||||||
ENV PYTHONUNBUFFERED=1
|
|
||||||
RUN apk add --update --no-cache python3 && ln -sf python3 /usr/bin/python
|
|
||||||
RUN python3 -m ensurepip
|
|
||||||
RUN pip3 install --no-cache --upgrade pip setuptools
|
|
||||||
RUN apk add --update alpine-sdk && \
|
|
||||||
apk add libffi-dev openssl-dev && \
|
|
||||||
apk add python3-dev && \
|
|
||||||
pnpm install -g @ship.zone/npmci node-gyp
|
|
||||||
68
Dockerfile_dbase
Normal file
68
Dockerfile_dbase
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
FROM docker:latest
|
||||||
|
LABEL author="Task Venture Capital GmbH <hello@task.vc>"
|
||||||
|
|
||||||
|
WORKDIR /workspace
|
||||||
|
|
||||||
|
# Important environment variables
|
||||||
|
ENV NODE_VERSION_LTS="24.13.0" \
|
||||||
|
NVM_DIR="/usr/local/nvm" \
|
||||||
|
PNPM_HOME="/root/.local/share/pnpm" \
|
||||||
|
NVM_NODEJS_ORG_MIRROR="https://unofficial-builds.nodejs.org/download/release"
|
||||||
|
|
||||||
|
# System packages (single layer)
|
||||||
|
# docker:latest already includes docker-cli and docker-compose plugin
|
||||||
|
RUN apk add --no-cache \
|
||||||
|
bash curl git openssl ca-certificates wget unzip jq \
|
||||||
|
build-base python3 python3-dev py3-pip linux-headers \
|
||||||
|
libgcc libstdc++ libc6-compat gnupg \
|
||||||
|
libffi-dev openssl-dev libc-dev \
|
||||||
|
iputils bind-tools \
|
||||||
|
tini
|
||||||
|
|
||||||
|
# Install NVM
|
||||||
|
RUN mkdir -p $NVM_DIR && curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
|
||||||
|
|
||||||
|
# Make nvm available globally in all bash shells
|
||||||
|
RUN printf '%s\n%s\n%s\n' \
|
||||||
|
'export NVM_DIR="/usr/local/nvm"' \
|
||||||
|
'[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"' \
|
||||||
|
'[ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion"' \
|
||||||
|
> /etc/bash.bashrc
|
||||||
|
|
||||||
|
# Copy nvm wrapper scripts
|
||||||
|
COPY image_support_files/bash-with-nvm /usr/local/bin/bash-with-nvm
|
||||||
|
COPY image_support_files/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
||||||
|
RUN chmod +x /usr/local/bin/bash-with-nvm /usr/local/bin/docker-entrypoint.sh
|
||||||
|
|
||||||
|
# Use wrapper for RUN commands to enable nvm
|
||||||
|
SHELL ["/usr/local/bin/bash-with-nvm"]
|
||||||
|
|
||||||
|
# Enable nvm for runtime bash commands
|
||||||
|
ENV BASH_ENV=/etc/bash.bashrc
|
||||||
|
|
||||||
|
# Prepare pnpm directory
|
||||||
|
RUN mkdir -p ${PNPM_HOME}
|
||||||
|
ENV PATH="$PNPM_HOME:$PATH"
|
||||||
|
|
||||||
|
# Install Node.js LTS via NVM and pnpm
|
||||||
|
# TARGETARCH fix: override nvm_get_arch for correct musl arch on arm64
|
||||||
|
ARG TARGETARCH
|
||||||
|
RUN NVM_MUSL_ARCH=$([ "$TARGETARCH" = "arm64" ] && echo "arm64-musl" || echo "x64-musl") \
|
||||||
|
&& nvm_get_arch() { echo "$NVM_MUSL_ARCH"; } \
|
||||||
|
&& nvm install $NODE_VERSION_LTS \
|
||||||
|
&& nvm alias default $NODE_VERSION_LTS \
|
||||||
|
&& nvm use default \
|
||||||
|
&& npm install -g pnpm \
|
||||||
|
&& pnpm -v \
|
||||||
|
&& pnpm config set unsafe-perm true \
|
||||||
|
&& pnpm install -g @ship.zone/szci
|
||||||
|
|
||||||
|
# Install Rust
|
||||||
|
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||||
|
ENV PATH="/root/.cargo/bin:$PATH"
|
||||||
|
|
||||||
|
ENV NODE_PATH=$NVM_DIR/versions/node/v$NODE_VERSION_LTS/lib/node_modules
|
||||||
|
ENV PATH=$NVM_DIR/versions/node/v$NODE_VERSION_LTS/bin:$PATH
|
||||||
|
|
||||||
|
ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/docker-entrypoint.sh"]
|
||||||
|
CMD ["bash"]
|
||||||
67
Dockerfile_dbase_dind
Normal file
67
Dockerfile_dbase_dind
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
FROM docker:dind
|
||||||
|
LABEL author="Task Venture Capital GmbH <hello@task.vc>"
|
||||||
|
|
||||||
|
WORKDIR /workspace
|
||||||
|
|
||||||
|
# Important environment variables
|
||||||
|
ENV NODE_VERSION_LTS="24.13.0" \
|
||||||
|
NVM_DIR="/usr/local/nvm" \
|
||||||
|
PNPM_HOME="/root/.local/share/pnpm" \
|
||||||
|
NVM_NODEJS_ORG_MIRROR="https://unofficial-builds.nodejs.org/download/release"
|
||||||
|
|
||||||
|
# System packages
|
||||||
|
RUN apk add --no-cache \
|
||||||
|
bash curl git openssl ca-certificates wget unzip \
|
||||||
|
build-base python3 python3-dev py3-pip linux-headers \
|
||||||
|
libgcc libstdc++ libc6-compat gnupg \
|
||||||
|
libffi-dev openssl-dev libc-dev \
|
||||||
|
iputils bind-tools \
|
||||||
|
tini
|
||||||
|
|
||||||
|
# Install NVM
|
||||||
|
RUN mkdir -p $NVM_DIR && curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
|
||||||
|
|
||||||
|
# Make nvm available globally in all bash shells
|
||||||
|
RUN printf '%s\n%s\n%s\n' \
|
||||||
|
'export NVM_DIR="/usr/local/nvm"' \
|
||||||
|
'[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"' \
|
||||||
|
'[ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion"' \
|
||||||
|
> /etc/bash.bashrc
|
||||||
|
|
||||||
|
# Copy nvm wrapper scripts
|
||||||
|
COPY image_support_files/bash-with-nvm /usr/local/bin/bash-with-nvm
|
||||||
|
COPY image_support_files/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
||||||
|
RUN chmod +x /usr/local/bin/bash-with-nvm /usr/local/bin/docker-entrypoint.sh
|
||||||
|
|
||||||
|
# Use wrapper for RUN commands to enable nvm
|
||||||
|
SHELL ["/usr/local/bin/bash-with-nvm"]
|
||||||
|
|
||||||
|
# Enable nvm for runtime bash commands (docker exec shells)
|
||||||
|
ENV BASH_ENV=/etc/bash.bashrc
|
||||||
|
|
||||||
|
# Prepare pnpm directory
|
||||||
|
RUN mkdir -p ${PNPM_HOME}
|
||||||
|
ENV PATH="$PNPM_HOME:$PATH"
|
||||||
|
|
||||||
|
# Install Node.js LTS via NVM and pnpm
|
||||||
|
# TARGETARCH fix: override nvm_get_arch for correct musl arch on arm64
|
||||||
|
ARG TARGETARCH
|
||||||
|
RUN NVM_MUSL_ARCH=$([ "$TARGETARCH" = "arm64" ] && echo "arm64-musl" || echo "x64-musl") \
|
||||||
|
&& nvm_get_arch() { echo "$NVM_MUSL_ARCH"; } \
|
||||||
|
&& nvm install $NODE_VERSION_LTS \
|
||||||
|
&& nvm alias default $NODE_VERSION_LTS \
|
||||||
|
&& nvm use default \
|
||||||
|
&& npm install -g pnpm \
|
||||||
|
&& pnpm -v \
|
||||||
|
&& pnpm config set unsafe-perm true \
|
||||||
|
&& pnpm install -g @ship.zone/szci
|
||||||
|
|
||||||
|
# Install Rust
|
||||||
|
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||||
|
ENV PATH="/root/.cargo/bin:$PATH"
|
||||||
|
|
||||||
|
ENV NODE_PATH=$NVM_DIR/versions/node/v$NODE_VERSION_LTS/lib/node_modules
|
||||||
|
ENV PATH=$NVM_DIR/versions/node/v$NODE_VERSION_LTS/bin:$PATH
|
||||||
|
|
||||||
|
ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/docker-entrypoint.sh"]
|
||||||
|
CMD ["bash"]
|
||||||
@@ -1,13 +1,7 @@
|
|||||||
FROM host.today/ht-docker-node:npmci
|
FROM host.today/ht-docker-node:szci
|
||||||
RUN npm install -g \
|
RUN pnpm install -g \
|
||||||
@git.zone/tsrun \
|
@git.zone/tsrun \
|
||||||
@git.zone/tstest \
|
@git.zone/tstest \
|
||||||
@push.rocks/qenv \
|
@git.zone/tsdocker \
|
||||||
@push.rocks/smartfile \
|
@git.zone/tsbundle \
|
||||||
@push.rocks/smartpath \
|
@git.zone/tools
|
||||||
@push.rocks/smartshell \
|
|
||||||
@push.rocks/tapbundle \
|
|
||||||
axios \
|
|
||||||
@push.rocks/smartdelay \
|
|
||||||
@push.rocks/smartjson \
|
|
||||||
@push.rocks/tapbundle
|
|
||||||
|
|||||||
@@ -4,5 +4,5 @@ LABEL author="Task Venture Capital GmbH <hello@task.vc>"
|
|||||||
RUN bash -c "source $NVM_DIR/nvm.sh \
|
RUN bash -c "source $NVM_DIR/nvm.sh \
|
||||||
&& nvm install $NODE_VERSION_LTS"
|
&& nvm install $NODE_VERSION_LTS"
|
||||||
|
|
||||||
ENV NODE_PATH $NVM_DIR/v$NODE_VERSION_LTS/lib/node_modules
|
ENV NODE_PATH $NVM_DIR/versions/node/v$NODE_VERSION_LTS/lib/node_modules
|
||||||
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION_LTS/bin:$PATH
|
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION_LTS/bin:$PATH
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
FROM host.today/ht-docker-node:latest
|
|
||||||
# Add Tini
|
|
||||||
ENV TINI_VERSION v0.19.0
|
|
||||||
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
|
|
||||||
RUN chmod +x /tini
|
|
||||||
ENTRYPOINT ["/tini", "--"]
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM host.today/ht-docker-node:latest
|
FROM host.today/ht-docker-node:latest
|
||||||
LABEL author="Task Venture Capital GmbH <hello@task.vc>"
|
LABEL author="Task Venture Capital GmbH <hello@task.vc>"
|
||||||
|
|
||||||
RUN pnpm install -g @ship.zone/npmci
|
RUN pnpm install -g @ship.zone/szci
|
||||||
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
|||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2016 Lossless GmbH
|
Copyright (c) 2016 Task Venture Capital GmbH
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
@@ -1,125 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
echo "🏔️ Building Multi-Architecture Alpine Docker Images"
|
|
||||||
echo "===================================================="
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
# Color codes
|
|
||||||
GREEN='\033[0;32m'
|
|
||||||
BLUE='\033[0;34m'
|
|
||||||
YELLOW='\033[1;33m'
|
|
||||||
NC='\033[0m' # No Color
|
|
||||||
|
|
||||||
# Check if buildx is available
|
|
||||||
if ! docker buildx version &> /dev/null; then
|
|
||||||
echo -e "${YELLOW}⚠️ docker buildx not found. Installing...${NC}"
|
|
||||||
docker buildx create --use
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Ensure buildx builder is running
|
|
||||||
echo -e "${BLUE}🔧 Setting up buildx builder...${NC}"
|
|
||||||
if ! docker buildx inspect default-builder &> /dev/null; then
|
|
||||||
docker buildx create --name default-builder --use
|
|
||||||
else
|
|
||||||
docker buildx use default-builder
|
|
||||||
fi
|
|
||||||
echo -e "${GREEN}✅ Buildx ready${NC}"
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
# Build function for multi-arch
|
|
||||||
build_multiarch_image() {
|
|
||||||
local dockerfile=$1
|
|
||||||
local tag=$2
|
|
||||||
local description=$3
|
|
||||||
|
|
||||||
echo -e "${BLUE}📦 Building Multi-Arch: ${NC}${description}"
|
|
||||||
echo -e "${YELLOW} Dockerfile: ${NC}${dockerfile}"
|
|
||||||
echo -e "${YELLOW} Tag: ${NC}${tag}"
|
|
||||||
echo -e "${YELLOW} Platforms: ${NC}linux/amd64, linux/arm64"
|
|
||||||
|
|
||||||
if docker buildx build \
|
|
||||||
--platform linux/amd64,linux/arm64 \
|
|
||||||
-f "${dockerfile}" \
|
|
||||||
-t "${tag}" \
|
|
||||||
--load \
|
|
||||||
.; then
|
|
||||||
echo -e "${GREEN}✅ Success: ${NC}${tag} (amd64 + arm64)"
|
|
||||||
echo ""
|
|
||||||
else
|
|
||||||
echo -e "\033[0;31m❌ Failed: ${NC}${tag}"
|
|
||||||
echo ""
|
|
||||||
echo -e "${YELLOW}💡 Note: Multi-arch builds with --load only work for single platform.${NC}"
|
|
||||||
echo -e "${YELLOW} To test locally, build for your native platform:${NC}"
|
|
||||||
echo -e "${YELLOW} docker buildx build --platform linux/amd64 -f ${dockerfile} -t ${tag} --load .${NC}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Build function for single platform (for local testing)
|
|
||||||
build_native_image() {
|
|
||||||
local dockerfile=$1
|
|
||||||
local tag=$2
|
|
||||||
local description=$3
|
|
||||||
local platform=$(uname -m)
|
|
||||||
|
|
||||||
# Convert platform name
|
|
||||||
if [ "$platform" = "x86_64" ]; then
|
|
||||||
platform="linux/amd64"
|
|
||||||
elif [ "$platform" = "aarch64" ] || [ "$platform" = "arm64" ]; then
|
|
||||||
platform="linux/arm64"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo -e "${BLUE}📦 Building Native: ${NC}${description}"
|
|
||||||
echo -e "${YELLOW} Dockerfile: ${NC}${dockerfile}"
|
|
||||||
echo -e "${YELLOW} Tag: ${NC}${tag}"
|
|
||||||
echo -e "${YELLOW} Platform: ${NC}${platform} (native)"
|
|
||||||
|
|
||||||
if docker buildx build \
|
|
||||||
--platform "${platform}" \
|
|
||||||
-f "${dockerfile}" \
|
|
||||||
-t "${tag}" \
|
|
||||||
--load \
|
|
||||||
.; then
|
|
||||||
echo -e "${GREEN}✅ Success: ${NC}${tag} (${platform})"
|
|
||||||
echo ""
|
|
||||||
else
|
|
||||||
echo -e "\033[0;31m❌ Failed: ${NC}${tag}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
echo -e "${BLUE}════════════════════════════════════════${NC}"
|
|
||||||
echo -e "${BLUE}Building Alpine Images${NC}"
|
|
||||||
echo -e "${BLUE}════════════════════════════════════════${NC}"
|
|
||||||
echo ""
|
|
||||||
echo -e "${YELLOW}💡 Building for native platform only (for local testing)${NC}"
|
|
||||||
echo -e "${YELLOW} To build multi-arch for push to registry, use:${NC}"
|
|
||||||
echo -e "${YELLOW} docker buildx build --platform linux/amd64,linux/arm64 --push ...${NC}"
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
# Build images for native platform (can be loaded for local testing)
|
|
||||||
build_native_image "Dockerfile_alpine_node" \
|
|
||||||
"ht-docker-node:alpine-node" \
|
|
||||||
"Alpine with Node.js LTS + NVM + pnpm"
|
|
||||||
|
|
||||||
build_native_image "Dockerfile_alpine_deno" \
|
|
||||||
"ht-docker-node:alpine-deno" \
|
|
||||||
"Alpine with Node.js LTS + NVM + Deno"
|
|
||||||
|
|
||||||
build_native_image "Dockerfile_alpine_bun" \
|
|
||||||
"ht-docker-node:alpine-bun" \
|
|
||||||
"Alpine with Node.js LTS + NVM + Bun"
|
|
||||||
|
|
||||||
# Summary
|
|
||||||
echo -e "${GREEN}════════════════════════════════════════${NC}"
|
|
||||||
echo -e "${GREEN}✨ All Alpine Images Built Successfully!${NC}"
|
|
||||||
echo -e "${GREEN}════════════════════════════════════════${NC}"
|
|
||||||
echo ""
|
|
||||||
echo "📋 Built Images (Native Platform):"
|
|
||||||
echo ""
|
|
||||||
docker images | grep "ht-docker-node:alpine" | awk '{printf " ✅ %-30s %10s\n", $1":"$2, $7" "$8}'
|
|
||||||
echo ""
|
|
||||||
echo -e "${YELLOW}💡 These images are built for your native architecture for local testing.${NC}"
|
|
||||||
echo -e "${YELLOW} In CI/CD, build with: docker buildx build --platform linux/amd64,linux/arm64 --push${NC}"
|
|
||||||
echo ""
|
|
||||||
82
changelog.md
82
changelog.md
@@ -1,5 +1,87 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2026-03-18 - 5.9.0 - feat(docker)
|
||||||
|
add a reusable Alpine base image and refactor Alpine variants to extend it
|
||||||
|
|
||||||
|
- introduces a new Dockerfile_alpine base image with NVM-managed Node.js for Alpine
|
||||||
|
- simplifies alpine-node, alpine-bun, and alpine-deno images by inheriting from the shared alpine base image
|
||||||
|
- adds jq to Debian and database images for improved shell tooling
|
||||||
|
- updates the release script to use verbose output and bumps @git.zone/tsdocker to ^2.1.0
|
||||||
|
|
||||||
|
## 2026-02-10 - 5.8.0 - feat(docker)
|
||||||
|
install Rust toolchain (rustup) and add aarch64 cross-compilation support to Docker images
|
||||||
|
|
||||||
|
- Install rustup and add /root/.cargo/bin to PATH in Dockerfile, Dockerfile_dbase, and Dockerfile_dbase_dind
|
||||||
|
- Add gcc-aarch64-linux-gnu package and run 'rustup target add aarch64-unknown-linux-gnu' in the main Dockerfile to enable cross-compilation
|
||||||
|
|
||||||
|
## 2026-02-07 - 5.7.0 - feat(docker)
|
||||||
|
install @ship.zone/szci in base images, add docker-entrypoint and use tini, remove deprecated Dockerfile_dbase_npmci, bump @git.zone/tsdocker devDependency to ^1.17.4
|
||||||
|
|
||||||
|
- Dockerfile_dbase: install @ship.zone/szci globally via pnpm
|
||||||
|
- Dockerfile_dbase_dind: add docker-entrypoint.sh and make it executable, consolidate chmod, set ENTRYPOINT to run tini with the new entrypoint and default CMD to ["bash"], and install @ship.zone/szci
|
||||||
|
- Remove Dockerfile_dbase_npmci (deleted)
|
||||||
|
- package.json: bump devDependency @git.zone/tsdocker from ^1.17.1 to ^1.17.4
|
||||||
|
|
||||||
|
## 2026-02-07 - 5.6.0 - feat(dockerfiles)
|
||||||
|
Add base Dockerfiles for dbase/dind, enable pnpm and stack-fix, update preinstalled image tooling and registries, and bump @git.zone/tsdocker devDependency
|
||||||
|
|
||||||
|
- Added Dockerfile_dbase: Alpine-based docker image with nodejs-current, pnpm installation, python/pip setup, compiles /lib/stack-fix.so and sets LD_PRELOAD, and enables pnpm unsafe-perm.
|
||||||
|
- Added Dockerfile_dbase_dind: multi-stage docker:dind build that installs same toolchain, compiles stack-fix.so in build stage, copies pnpm/python artifacts to final stage, and preserves LD_PRELOAD.
|
||||||
|
- Added Dockerfile_dbase_npmci: lightweight image FROM hosttoday/ht-docker-dbase:latest that installs @ship.zone/npmci globally via pnpm.
|
||||||
|
- Updated Dockerfile_fossglobal_preinstalled_##version##: switched from npm to pnpm and replaced several global packages (removed push.rocks/* and axios; added @git.zone/tsdocker, @git.zone/tsbundle, @git.zone/tools).
|
||||||
|
- Updated npmextra.json: cleared szci.dockerRegistries and simplified @git.zone/tsdocker registries/registryRepoMap to only use code.foss.global and preserved platforms/testDir.
|
||||||
|
- Bumped devDependency @git.zone/tsdocker from ^1.17.0 to ^1.17.1 (patch bump).
|
||||||
|
|
||||||
|
## 2026-02-07 - 5.5.2 - fix()
|
||||||
|
no changes detected — no release necessary
|
||||||
|
|
||||||
|
- No files changed in the provided git diff
|
||||||
|
- Current package.json version is 5.5.1
|
||||||
|
|
||||||
|
## 2026-02-07 - 5.5.1 - fix(docker)
|
||||||
|
normalize NODE_PATH and harden Dockerfile installs; use curl -fsSL; consolidate Alpine apk installs; update .dockerignore; bump @git.zone/tsdocker devDependency
|
||||||
|
|
||||||
|
- Change NODE_PATH to $NVM_DIR/versions/node/v... across Dockerfiles to match nvm layout
|
||||||
|
- Use curl -fsSL for non-interactive installs
|
||||||
|
- Run apt-get clean and remove /var/lib/apt/lists to reduce image size and ensure clean state
|
||||||
|
- Consolidate apk add commands and ensure python3 symlink and pnpm global installs in Alpine image
|
||||||
|
- Add .dockerignore entries to exclude build artifacts and include image_support_files
|
||||||
|
- Bump devDependency @git.zone/tsdocker from ^1.15.1 to ^1.16.0
|
||||||
|
|
||||||
|
## 2026-02-07 - 5.5.0 - feat(docker)
|
||||||
|
Rework Dockerfile into layered installs and add tooling (tini, chromium, MongoDB); simplify Alpine CI image Python/pip setup; add tsdocker devDependency; remove npmextra push flag; update README and registry links
|
||||||
|
|
||||||
|
- Dockerfile: split apt installs into logical layers, added tini, iputils-ping and dnsutils, moved chromium-browser into its own layer, and fixed apt cache cleanup (rm -rf)
|
||||||
|
- Dockerfile: add MongoDB 8.0 apt repository and install in a dedicated layer
|
||||||
|
- Alpine image (Dockerfile_alpine-szci): consolidated python3 and py3-pip install (removed ensurepip + manual pip upgrade)
|
||||||
|
- package.json: add devDependency @git.zone/tsdocker@^1.15.1
|
||||||
|
- npmextra.json: removed "push": false flag (affects CI/publish behavior)
|
||||||
|
- README: update registry URLs to code.foss.global, document tini and NVM behavior, refresh image descriptions and links
|
||||||
|
|
||||||
|
## 2026-02-06 - 5.4.0 - feat(ci)
|
||||||
|
replace npmci with szci across CI and images; add szci preinstalled images and make tini the PID 1 init in Docker images
|
||||||
|
|
||||||
|
- Replace @ship.zone/npmci with @ship.zone/szci in Gitea CI workflows (.gitea/workflows/docker_nottags.yaml, docker_tags.yaml) and update commands to use szci
|
||||||
|
- Add szci-specific Dockerfiles (Dockerfile_szci, Dockerfile_alpine-szci) and tests (test/test_szci.sh); remove npmci-specific files
|
||||||
|
- Install and use tini as PID 1 in multiple Dockerfiles and switch ENTRYPOINT to run tini for proper signal forwarding and zombie reaping
|
||||||
|
- Update metadata/manifest files (package.json, npmextra.json, readme.*, Dockerfile base tags) to reference szci and document the inclusion of tini
|
||||||
|
|
||||||
|
## 2026-02-06 - 5.3.0 - feat(docker)
|
||||||
|
add Chromium support for Puppeteer/Playwright and npm build/release scripts
|
||||||
|
|
||||||
|
- Add PUPPETEER_EXECUTABLE_PATH and CHROME_BIN env vars pointing to /usr/bin/chromium-browser for Puppeteer/Playwright compatibility
|
||||||
|
- Replace Google Chrome .deb download with apt-get install chromium-browser for multi-arch (amd64/arm64) compatibility
|
||||||
|
- Add npm scripts: 'build' -> 'tsdocker build' and 'release' -> 'tsdocker push' in package.json
|
||||||
|
|
||||||
|
## 2026-02-06 - 5.2.0 - feat(ci)
|
||||||
|
switch CI to use @git.zone/tsdocker and add tsdocker config and image tests
|
||||||
|
|
||||||
|
- Replace @ship.zone/npmci with @git.zone/tsdocker in CI workflow and use tsdocker commands: login, list, build, test, push
|
||||||
|
- Add npmextra.json configuration for @git.zone/tsdocker (registries, registryRepoMap, platforms, push/testDir)
|
||||||
|
- Add Dockerfile_alpine-npmci and per-image test scripts under test/ (alpine-bun, alpine-deno, alpine-node)
|
||||||
|
- Remove legacy Alpine Dockerfiles and legacy build/test scripts (Dockerfile_alpine_node/deno/bun/_npmci, build-alpine-images.sh, test-alpine-images.sh)
|
||||||
|
- Update LICENSE copyright owner to Task Venture Capital GmbH
|
||||||
|
|
||||||
## 2025-10-26 - 5.1.0 - feat(alpine-deno)
|
## 2025-10-26 - 5.1.0 - feat(alpine-deno)
|
||||||
Improve alpine deno image: switch to alpine:edge and use native Deno package, remove glibc workaround, update NVM/PATH, add local tooling settings and expanded README
|
Improve alpine deno image: switch to alpine:edge and use native Deno package, remove glibc workaround, update NVM/PATH, add local tooling settings and expanded README
|
||||||
|
|
||||||
|
|||||||
@@ -16,17 +16,24 @@
|
|||||||
"CI",
|
"CI",
|
||||||
"git",
|
"git",
|
||||||
"ssh",
|
"ssh",
|
||||||
"npmci",
|
"szci",
|
||||||
"node version management",
|
"node version management",
|
||||||
"typescript"
|
"typescript"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"npmci": {
|
"szci": {
|
||||||
"dockerRegistries": [
|
"dockerRegistries": []
|
||||||
"docker.io",
|
},
|
||||||
"registry.gitlab.com"
|
"@git.zone/tsdocker": {
|
||||||
]
|
"registries": [
|
||||||
|
"code.foss.global"
|
||||||
|
],
|
||||||
|
"registryRepoMap": {
|
||||||
|
"code.foss.global": "host.today/ht-docker-node"
|
||||||
|
},
|
||||||
|
"platforms": ["linux/amd64", "linux/arm64"],
|
||||||
|
"testDir": "./test"
|
||||||
},
|
},
|
||||||
"tsdoc": {
|
"tsdoc": {
|
||||||
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
|
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
|
||||||
|
|||||||
25
package.json
25
package.json
@@ -1,34 +1,24 @@
|
|||||||
{
|
{
|
||||||
"name": "ht-docker-node",
|
"name": "ht-docker-node",
|
||||||
"version": "5.1.0",
|
"version": "5.9.0",
|
||||||
"description": "A Docker image that integrates Node.js with shipzone.io support.",
|
"description": "A Docker image that integrates Node.js with shipzone.io support.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"no npm test specified\"",
|
"test": "echo \"no npm test specified\"",
|
||||||
"build": "echo \"Not needed for now\""
|
"build": "tsdocker build",
|
||||||
|
"release": "tsdocker push --verbose"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/HostToday/ht-docker-node.git"
|
"url": "git+https://github.com/HostToday/ht-docker-node.git"
|
||||||
},
|
},
|
||||||
"author": "Lossless GmbH",
|
"author": "Task Venture Capital GmbH",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/HostToday/ht-docker-node/issues"
|
"url": "https://github.com/HostToday/ht-docker-node/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/HostToday/ht-docker-node#readme",
|
"homepage": "https://github.com/HostToday/ht-docker-node#readme",
|
||||||
"private": true,
|
"private": true,
|
||||||
"files": [
|
|
||||||
"ts/*",
|
|
||||||
"ts_web/*",
|
|
||||||
"dist/*",
|
|
||||||
"dist_web/*",
|
|
||||||
"dist_ts_web/*",
|
|
||||||
"assets/*",
|
|
||||||
"cli.js",
|
|
||||||
"npmextra.json",
|
|
||||||
"readme.md"
|
|
||||||
],
|
|
||||||
"directories": {
|
"directories": {
|
||||||
"test": "test"
|
"test": "test"
|
||||||
},
|
},
|
||||||
@@ -40,8 +30,11 @@
|
|||||||
"CI",
|
"CI",
|
||||||
"git",
|
"git",
|
||||||
"ssh",
|
"ssh",
|
||||||
"npmci",
|
"szci",
|
||||||
"node version management",
|
"node version management",
|
||||||
"typescript"
|
"typescript"
|
||||||
]
|
],
|
||||||
|
"devDependencies": {
|
||||||
|
"@git.zone/tsdocker": "^2.1.0"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
3109
pnpm-lock.yaml
generated
3109
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
# Technical Implementation Notes
|
# Technical Implementation Notes
|
||||||
|
|
||||||
## NVM Support (v5.0.147)
|
## NVM Support (v5.2.0)
|
||||||
|
|
||||||
### How NVM Works in This Image
|
### How NVM Works in This Image
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@ The image provides full nvm support in three contexts:
|
|||||||
- Critical for CI/CD workflow support
|
- Critical for CI/CD workflow support
|
||||||
|
|
||||||
#### 4. ENV PATH Fallback
|
#### 4. ENV PATH Fallback
|
||||||
- Maintains `ENV PATH` pointing to default Node v20.12.2
|
- Maintains `ENV PATH` pointing to default Node v24.13.0
|
||||||
- Ensures non-bash shells (sh, dash) still have node access
|
- Ensures non-bash shells (sh, dash) still have node access
|
||||||
- Backward compatible with existing usage
|
- Backward compatible with existing usage
|
||||||
|
|
||||||
@@ -68,16 +68,29 @@ RUN node --version # Now shows v18.x.x
|
|||||||
- ✅ Dockerfile RUN: `nvm install`, `nvm use`, version switching
|
- ✅ Dockerfile RUN: `nvm install`, `nvm use`, version switching
|
||||||
- ✅ Runtime bash -c: All nvm commands work
|
- ✅ Runtime bash -c: All nvm commands work
|
||||||
- ✅ CI/CD workflows: Tested in .gitea/workflows context
|
- ✅ CI/CD workflows: Tested in .gitea/workflows context
|
||||||
- ✅ Backward compat: pnpm, npmci, ENV PATH fallback
|
- ✅ Backward compat: pnpm, szci, ENV PATH fallback
|
||||||
- ✅ Multi-stage builds: nvm available in all stages
|
- ✅ Multi-stage builds: nvm available in all stages
|
||||||
- ✅ Interactive shells: Full nvm access
|
- ✅ Interactive shells: Full nvm access
|
||||||
|
|
||||||
### Maintenance Notes
|
### Maintenance Notes
|
||||||
|
|
||||||
**If updating nvm version**: Modify line 86 in Dockerfile
|
**If updating nvm version**: Modify line 87 in Dockerfile (currently NVM v0.40.1)
|
||||||
|
|
||||||
**If base image changes**: Verify /etc/bash.bashrc structure still has early return pattern
|
**If base image changes**: Verify /etc/bash.bashrc structure still has early return pattern
|
||||||
|
|
||||||
|
## Ubuntu 24.04 Upgrade Notes
|
||||||
|
|
||||||
|
- Base image upgraded from Ubuntu 20.04 to 24.04
|
||||||
|
- Python 2 removed (EOL since 2020), Python 3 retained
|
||||||
|
- Package changes for 24.04 compatibility:
|
||||||
|
- `gconf-service` and `libgconf-2-4` removed (deprecated GConf)
|
||||||
|
- `libgcc1` replaced with `libgcc-s1`
|
||||||
|
- `libappindicator1` replaced with `libayatana-appindicator3-1`
|
||||||
|
- `libasound2` replaced with `libasound2t64` (t64 transition)
|
||||||
|
- `libgbm1` and `libatk-bridge2.0-0` added for Chrome/Puppeteer
|
||||||
|
- MongoDB upgraded from 4.4 to 8.0 (uses modern gpg keyring approach instead of deprecated apt-key)
|
||||||
|
- Node.js upgraded to v24.13.0 LTS (Krypton, supported until April 2028)
|
||||||
|
|
||||||
**If ENTRYPOINT conflicts**: Users can override with `--entrypoint` flag:
|
**If ENTRYPOINT conflicts**: Users can override with `--entrypoint` flag:
|
||||||
```bash
|
```bash
|
||||||
docker run --entrypoint /bin/bash image -c "commands"
|
docker run --entrypoint /bin/bash image -c "commands"
|
||||||
|
|||||||
566
readme.md
566
readme.md
@@ -1,122 +1,163 @@
|
|||||||
# 🐳 ht-docker-node
|
# 🐳 ht-docker-node
|
||||||
|
|
||||||
> Production-ready Docker images for Node.js development with multi-architecture support, modern runtimes, and intelligent version management.
|
> Production-ready Docker images for Node.js with NVM built in, multi-arch support, and modern runtimes (Bun, Deno). Every image ships with **tini** as PID 1 and full **NVM** integration — switch Node versions on the fly, no sourcing required.
|
||||||
|
|
||||||
**Multi-arch ready** • **Alpine & Ubuntu** • **NVM built-in** • **Bun, Deno & pnpm** • **CI/CD optimized**
|
**Multi-arch** • **Alpine & Ubuntu** • **NVM built-in** • **Bun, Deno & pnpm** • **tini init** • **CI/CD optimized**
|
||||||
|
|
||||||
|
## Issue Reporting and Security
|
||||||
|
|
||||||
|
For reporting bugs, issues, or security vulnerabilities, please visit [community.foss.global/](https://community.foss.global/). This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a [code.foss.global/](https://code.foss.global/) account to submit Pull Requests directly.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 🚀 Quick Start
|
## 🚀 Quick Start
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Pull and run the latest Node.js LTS image
|
# Pull and run the full-featured Ubuntu image
|
||||||
docker pull registry.gitlab.com/hosttoday/ht-docker-node:latest
|
docker pull code.foss.global/host.today/ht-docker-node:latest
|
||||||
docker run -it registry.gitlab.com/hosttoday/ht-docker-node:latest
|
docker run -it code.foss.global/host.today/ht-docker-node:latest
|
||||||
|
|
||||||
# Or use Alpine for smaller images (200MB vs 800MB+)
|
# Or go lean with Alpine (~200 MB vs ~900 MB)
|
||||||
docker pull registry.gitlab.com/hosttoday/ht-docker-node:alpine-node
|
docker pull code.foss.global/host.today/ht-docker-node:alpine-node
|
||||||
|
docker run -it code.foss.global/host.today/ht-docker-node:alpine-node
|
||||||
```
|
```
|
||||||
|
|
||||||
|
NVM is ready the moment you enter the container — no manual sourcing, no `.bashrc` hacks:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ nvm install 22
|
||||||
|
$ nvm use 22
|
||||||
|
$ node -v # v22.x.x ✅
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## 📦 Available Images
|
## 📦 Available Images
|
||||||
|
|
||||||
### Ubuntu-Based Images (Full-Featured)
|
### Ubuntu-Based (Full-Featured)
|
||||||
|
|
||||||
Perfect for complex builds requiring native dependencies and maximum compatibility.
|
Built on **Ubuntu 24.04**. Maximum compatibility, all build tools included, plus Chromium for Puppeteer/Playwright, and MongoDB 8.0.
|
||||||
|
|
||||||
| Tag | Description | Use Case |
|
| Tag | Description | Key Contents |
|
||||||
|-----|-------------|----------|
|
|-----|-------------|--------------|
|
||||||
| `:latest` / `:lts` | Node.js LTS with NVM | General purpose, production builds |
|
| `:latest` | Kitchen-sink Node.js image | Node LTS + NVM + pnpm + Bun + Deno + Chromium + MongoDB 8.0 |
|
||||||
| `:stable` | Node.js stable release | Latest stable features |
|
| `:lts` | Alias of `:latest` | Same — explicit LTS naming for clarity |
|
||||||
| `:npmci` | With npmci preinstalled | CI/CD pipelines |
|
| `:szci` | CI/CD workhorse | `:latest` + `@ship.zone/szci` preinstalled |
|
||||||
| `:npmts` | npmci + npmts | TypeScript projects |
|
| `:fossglobal_preinstalled_<ver>` | Preloaded tooling image | `:szci` + tsrun, tstest, tapbundle, smartfile, and more |
|
||||||
| `:npmpage` | npmci + npmts + npmpage | Static site generation |
|
|
||||||
| `:mongo` | npmci + npmts + MongoDB | Full-stack development |
|
|
||||||
|
|
||||||
### Alpine-Based Images (Lightweight & Multi-Arch) ⚡
|
### Alpine-Based (Lightweight & Multi-Arch) ⚡
|
||||||
|
|
||||||
**40-60% smaller** than Ubuntu images. Native performance on **both x64 and ARM64** (Apple Silicon, ARM servers).
|
**40–75 % smaller** than Ubuntu. Native performance on **both amd64 and arm64** (Apple Silicon, Graviton, Ampere).
|
||||||
|
|
||||||
| Tag | Description | Size | Architectures |
|
| Tag | Description | Size | Architectures |
|
||||||
|-----|-------------|------|---------------|
|
|-----|-------------|------|---------------|
|
||||||
| `:alpine-node` | Node.js LTS + NVM + pnpm | ~200 MB | amd64, arm64 |
|
| `:alpine-node` | Node.js LTS + NVM + pnpm | ~200 MB | amd64, arm64 |
|
||||||
| `:alpine-deno` | Node.js LTS + NVM + Deno | ~180MB | amd64, arm64 |
|
|
||||||
| `:alpine-bun` | Node.js LTS + NVM + Bun | ~150 MB | amd64, arm64 |
|
| `:alpine-bun` | Node.js LTS + NVM + Bun | ~150 MB | amd64, arm64 |
|
||||||
|
| `:alpine-deno` | Node.js LTS + NVM + Deno | ~180 MB | amd64, arm64 |
|
||||||
|
| `:alpine-szci` | Alpine Node + szci + build tools | ~250 MB | amd64, arm64 |
|
||||||
|
|
||||||
**✨ Multi-architecture magic:** Docker automatically selects the right image for your platform. Build on Mac, deploy on Linux servers—same Dockerfile, native speed everywhere.
|
> 💡 Docker automatically pulls the right arch for your platform. Build on a Mac, deploy on an ARM server — same tag, native speed everywhere.
|
||||||
|
|
||||||
> **Note:** The Deno image uses Alpine edge to access the official musl-compiled Deno package from Alpine's community repository.
|
> **Note:** The Deno Alpine image uses `alpine:edge` to get the official musl-compiled Deno from the community repository.
|
||||||
|
|
||||||
|
### What every image includes
|
||||||
|
|
||||||
|
| Feature | Detail |
|
||||||
|
|---------|--------|
|
||||||
|
| **tini** | PID 1 init — proper signal forwarding & zombie reaping |
|
||||||
|
| **NVM** | v0.40.1 — works in `RUN`, `docker exec`, CI scripts, interactive shells |
|
||||||
|
| **Node.js** | LTS v24.13.0 (default, switchable) |
|
||||||
|
| **docker-entrypoint.sh** | Loads NVM at runtime so `docker run … bash -c "nvm use 22"` just works |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 💡 Key Features
|
## 💡 Key Features
|
||||||
|
|
||||||
### 🔄 NVM (Node Version Manager) Built-In
|
### 🔄 NVM — Zero-Config Node Version Management
|
||||||
|
|
||||||
Switch Node.js versions **instantly** without rebuilding images:
|
NVM is pre-wired into every shell context. No manual sourcing required in any of these scenarios:
|
||||||
|
|
||||||
|
**Dockerfile RUN commands** (via the `bash-with-nvm` SHELL wrapper):
|
||||||
|
|
||||||
```dockerfile
|
```dockerfile
|
||||||
FROM registry.gitlab.com/hosttoday/ht-docker-node:latest
|
FROM code.foss.global/host.today/ht-docker-node:latest
|
||||||
|
|
||||||
# Works directly in RUN commands - no sourcing needed!
|
# Works directly — no sourcing needed!
|
||||||
RUN nvm install 18.20.0
|
RUN nvm install 22 && nvm use 22 && npm ci
|
||||||
RUN nvm use 18 && npm install
|
RUN nvm alias default 22 # persists for later RUN steps
|
||||||
RUN nvm install 20 && nvm use 20 && npm test
|
|
||||||
|
|
||||||
# Set default for subsequent commands
|
|
||||||
RUN nvm install 19 && nvm alias default 19
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### 🎯 CI/CD Workflow Ready
|
**CI/CD scripts** (via `BASH_ENV=/etc/bash.bashrc`):
|
||||||
|
|
||||||
NVM works seamlessly in GitHub Actions, GitLab CI, and other automation:
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
# .gitlab-ci.yml
|
# Gitea / GitLab CI
|
||||||
test:
|
test:
|
||||||
image: registry.gitlab.com/hosttoday/ht-docker-node:latest
|
image: code.foss.global/host.today/ht-docker-node:latest
|
||||||
script:
|
script:
|
||||||
- nvm install 18
|
- nvm install 22 && nvm use 22
|
||||||
- nvm use 18
|
- pnpm ci && pnpm test
|
||||||
- npm ci
|
|
||||||
- npm test
|
|
||||||
|
|
||||||
# Test on multiple Node versions
|
|
||||||
- nvm install 20
|
|
||||||
- nvm use 20
|
|
||||||
- npm test
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### 🏔️ Alpine: Production-Optimized
|
**Interactive shells** and **`docker exec`**:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker exec -it mycontainer bash
|
||||||
|
$ nvm ls # lists installed versions
|
||||||
|
$ nvm install 20 # installs Node 20
|
||||||
|
$ nvm use 20 # switches immediately
|
||||||
|
```
|
||||||
|
|
||||||
|
> ⚠️ **Note on version persistence across RUN steps:** Each Dockerfile `RUN` starts a new shell. Use `nvm alias default <version>` to persist your choice, or chain commands in a single `RUN`.
|
||||||
|
|
||||||
|
### 🛡️ tini — Proper Init for Containers
|
||||||
|
|
||||||
|
All images use [tini](https://github.com/krallin/tini) as PID 1:
|
||||||
|
|
||||||
|
```
|
||||||
|
tini → docker-entrypoint.sh → your command
|
||||||
|
```
|
||||||
|
|
||||||
|
This means:
|
||||||
|
- ✅ Signals (SIGTERM, SIGINT) are forwarded correctly to your app
|
||||||
|
- ✅ Zombie processes are reaped automatically
|
||||||
|
- ✅ Clean container shutdown — no orphaned processes
|
||||||
|
|
||||||
|
### 🌐 Chromium (Ubuntu `:latest` only)
|
||||||
|
|
||||||
|
Puppeteer and Playwright work out of the box:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
const browser = await puppeteer.launch(); // uses /usr/bin/chromium-browser
|
||||||
|
```
|
||||||
|
|
||||||
|
Environment variables `PUPPETEER_EXECUTABLE_PATH` and `CHROME_BIN` are pre-set. Multi-arch compatible (amd64 + arm64).
|
||||||
|
|
||||||
|
### 🏔️ Alpine — Production Optimized
|
||||||
|
|
||||||
```dockerfile
|
```dockerfile
|
||||||
FROM registry.gitlab.com/hosttoday/ht-docker-node:alpine-node
|
FROM code.foss.global/host.today/ht-docker-node:alpine-node
|
||||||
|
|
||||||
# Same NVM commands as Ubuntu
|
RUN nvm install 22 && nvm use 22
|
||||||
RUN nvm install 20 && nvm use 20
|
RUN pnpm install && pnpm build
|
||||||
RUN pnpm install
|
# Result: ~200 MB image
|
||||||
RUN pnpm build
|
|
||||||
|
|
||||||
# Result: 200MB image vs 800MB+ Ubuntu
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Why Alpine?**
|
Why Alpine?
|
||||||
- ✅ **60-75% smaller images** → Faster deployments
|
- ✅ **60–75 % smaller** → Faster pulls, faster deploys
|
||||||
- ✅ **Reduced attack surface** → Better security
|
- ✅ **Reduced attack surface** → Fewer packages = fewer CVEs
|
||||||
- ✅ **Native musl builds** → No glibc compatibility issues
|
- ✅ **Native musl builds** → No glibc compatibility layer
|
||||||
- ✅ **Multi-arch support** → One image, all platforms
|
- ✅ **Multi-arch** → Same tag works on x64 and ARM64
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 🛠️ Usage Examples
|
## 🛠️ Usage Examples
|
||||||
|
|
||||||
### Basic Node.js Application
|
### Basic Node.js App
|
||||||
|
|
||||||
```dockerfile
|
```dockerfile
|
||||||
FROM registry.gitlab.com/hosttoday/ht-docker-node:alpine-node
|
FROM code.foss.global/host.today/ht-docker-node:alpine-node
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# NVM is already configured, Node.js LTS is ready
|
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
RUN pnpm install
|
RUN pnpm install
|
||||||
|
|
||||||
@@ -130,389 +171,238 @@ CMD ["node", "dist/index.js"]
|
|||||||
### Multi-Version Testing
|
### Multi-Version Testing
|
||||||
|
|
||||||
```dockerfile
|
```dockerfile
|
||||||
FROM registry.gitlab.com/hosttoday/ht-docker-node:latest
|
FROM code.foss.global/host.today/ht-docker-node:latest
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
|
|
||||||
# Test on Node 18
|
|
||||||
RUN nvm install 18 && nvm use 18 && npm ci && npm test
|
|
||||||
|
|
||||||
# Test on Node 20
|
|
||||||
RUN nvm install 20 && nvm use 20 && npm ci && npm test
|
RUN nvm install 20 && nvm use 20 && npm ci && npm test
|
||||||
|
RUN nvm install 22 && nvm use 22 && npm ci && npm test
|
||||||
|
|
||||||
# Use Node 20 for production build
|
# Ship with Node 22
|
||||||
RUN nvm alias default 20 && npm run build
|
RUN nvm alias default 22 && npm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
### Deno Application
|
### Deno Application
|
||||||
|
|
||||||
```dockerfile
|
```dockerfile
|
||||||
FROM registry.gitlab.com/hosttoday/ht-docker-node:alpine-deno
|
FROM code.foss.global/host.today/ht-docker-node:alpine-deno
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Both Deno and Node.js are available
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Use Deno for the app
|
# Deno and Node.js are both available
|
||||||
CMD ["deno", "run", "--allow-net", "main.ts"]
|
CMD ["deno", "run", "--allow-net", "main.ts"]
|
||||||
|
|
||||||
# Or switch to Node.js if needed
|
|
||||||
# RUN nvm use default && npm install
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Bun for Ultra-Fast Builds
|
### Bun for Ultra-Fast Installs
|
||||||
|
|
||||||
```dockerfile
|
```dockerfile
|
||||||
FROM registry.gitlab.com/hosttoday/ht-docker-node:alpine-bun
|
FROM code.foss.global/host.today/ht-docker-node:alpine-bun
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Bun is 10-20x faster for package installation
|
|
||||||
COPY package.json bun.lockb ./
|
COPY package.json bun.lockb ./
|
||||||
RUN bun install
|
RUN bun install
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN bun run build
|
RUN bun run build
|
||||||
|
|
||||||
# Node.js also available via NVM
|
|
||||||
CMD ["bun", "run", "start"]
|
CMD ["bun", "run", "start"]
|
||||||
```
|
```
|
||||||
|
|
||||||
### TypeScript Project with Multi-Stage Build
|
### TypeScript Multi-Stage Build
|
||||||
|
|
||||||
```dockerfile
|
```dockerfile
|
||||||
# Build stage
|
# Build stage
|
||||||
FROM registry.gitlab.com/hosttoday/ht-docker-node:alpine-node AS builder
|
FROM code.foss.global/host.today/ht-docker-node:alpine-node AS builder
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
RUN pnpm install
|
RUN pnpm install
|
||||||
|
|
||||||
COPY tsconfig.json ./
|
COPY tsconfig.json ./
|
||||||
COPY src ./src
|
COPY src ./src
|
||||||
RUN pnpm build
|
RUN pnpm build
|
||||||
|
|
||||||
# Production stage
|
# Production stage — only runtime deps
|
||||||
FROM registry.gitlab.com/hosttoday/ht-docker-node:alpine-node
|
FROM code.foss.global/host.today/ht-docker-node:alpine-node
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
RUN pnpm install --prod
|
RUN pnpm install --prod
|
||||||
|
|
||||||
COPY --from=builder /app/dist ./dist
|
COPY --from=builder /app/dist ./dist
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
CMD ["node", "dist/index.js"]
|
CMD ["node", "dist/index.js"]
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
### Production-Hardened Setup
|
||||||
|
|
||||||
## 🔧 NVM Usage Patterns
|
|
||||||
|
|
||||||
### In Dockerfiles
|
|
||||||
|
|
||||||
```dockerfile
|
```dockerfile
|
||||||
# Install specific version
|
FROM code.foss.global/host.today/ht-docker-node:alpine-node
|
||||||
RUN nvm install 18.20.0
|
|
||||||
|
|
||||||
# Use version
|
# Non-root user
|
||||||
RUN nvm use 18
|
|
||||||
|
|
||||||
# Set default (persists across RUN commands)
|
|
||||||
RUN nvm alias default 18
|
|
||||||
|
|
||||||
# Chain commands in single RUN
|
|
||||||
RUN nvm install 19 && nvm use 19 && npm install
|
|
||||||
```
|
|
||||||
|
|
||||||
### In CI/CD Scripts
|
|
||||||
|
|
||||||
```bash
|
|
||||||
#!/bin/bash
|
|
||||||
# NVM is automatically available in bash scripts
|
|
||||||
|
|
||||||
nvm install 20
|
|
||||||
nvm use 20
|
|
||||||
npm ci
|
|
||||||
npm test
|
|
||||||
```
|
|
||||||
|
|
||||||
### Version Switching
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# List installed versions
|
|
||||||
nvm ls
|
|
||||||
|
|
||||||
# Install and switch to latest LTS
|
|
||||||
nvm install --lts
|
|
||||||
nvm use --lts
|
|
||||||
|
|
||||||
# Install specific version
|
|
||||||
nvm install 18.20.0
|
|
||||||
|
|
||||||
# Use installed version
|
|
||||||
nvm use 18
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 🏗️ Building Multi-Architecture Images
|
|
||||||
|
|
||||||
For teams building custom images:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Clone the repo
|
|
||||||
git clone https://github.com/HostToday/ht-docker-node.git
|
|
||||||
cd ht-docker-node
|
|
||||||
|
|
||||||
# Build Alpine images (native platform for local testing)
|
|
||||||
chmod +x build-alpine-images.sh
|
|
||||||
./build-alpine-images.sh
|
|
||||||
|
|
||||||
# Test the built images
|
|
||||||
chmod +x test-alpine-images.sh
|
|
||||||
./test-alpine-images.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
### Production Multi-Arch Builds
|
|
||||||
|
|
||||||
For publishing to registries:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Build for both amd64 and arm64, push to registry
|
|
||||||
docker buildx build \
|
|
||||||
--platform linux/amd64,linux/arm64 \
|
|
||||||
-f Dockerfile_alpine_node \
|
|
||||||
-t your-registry/your-image:alpine-node \
|
|
||||||
--push \
|
|
||||||
.
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 📚 Advanced Examples
|
|
||||||
|
|
||||||
### Docker Compose Setup
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
version: '3.8'
|
|
||||||
|
|
||||||
services:
|
|
||||||
app:
|
|
||||||
image: registry.gitlab.com/hosttoday/ht-docker-node:alpine-node
|
|
||||||
working_dir: /app
|
|
||||||
volumes:
|
|
||||||
- .:/app
|
|
||||||
- /app/node_modules
|
|
||||||
ports:
|
|
||||||
- "3000:3000"
|
|
||||||
environment:
|
|
||||||
- NODE_ENV=development
|
|
||||||
command: sh -c "pnpm install && pnpm dev"
|
|
||||||
|
|
||||||
mongo:
|
|
||||||
image: mongo:latest
|
|
||||||
ports:
|
|
||||||
- "27017:27017"
|
|
||||||
```
|
|
||||||
|
|
||||||
### GitHub Actions Workflow
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
name: CI
|
|
||||||
|
|
||||||
on: [push, pull_request]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
container:
|
|
||||||
image: registry.gitlab.com/hosttoday/ht-docker-node:alpine-node
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install
|
|
||||||
|
|
||||||
- name: Run tests
|
|
||||||
run: pnpm test
|
|
||||||
|
|
||||||
- name: Test on multiple Node versions
|
|
||||||
run: |
|
|
||||||
for version in 18 20; do
|
|
||||||
echo "Testing on Node $version"
|
|
||||||
nvm install $version
|
|
||||||
nvm use $version
|
|
||||||
pnpm test
|
|
||||||
done
|
|
||||||
```
|
|
||||||
|
|
||||||
### Custom Base Image
|
|
||||||
|
|
||||||
```dockerfile
|
|
||||||
FROM registry.gitlab.com/hosttoday/ht-docker-node:alpine-node
|
|
||||||
|
|
||||||
# Add your custom tools
|
|
||||||
RUN apk add --no-cache \
|
|
||||||
python3 \
|
|
||||||
make \
|
|
||||||
g++ \
|
|
||||||
postgresql-client
|
|
||||||
|
|
||||||
# Configure your environment
|
|
||||||
ENV DATABASE_URL="postgresql://localhost/mydb"
|
|
||||||
|
|
||||||
# Your app setup
|
|
||||||
WORKDIR /app
|
|
||||||
COPY package.json pnpm-lock.yaml ./
|
|
||||||
RUN pnpm install
|
|
||||||
|
|
||||||
COPY . .
|
|
||||||
CMD ["pnpm", "start"]
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 🎓 Best Practices
|
|
||||||
|
|
||||||
### ✅ DO
|
|
||||||
|
|
||||||
- **Use Alpine images for production** (smaller, more secure)
|
|
||||||
- **Pin Node versions in production** (`nvm alias default 20.11.0`)
|
|
||||||
- **Use multi-stage builds** to reduce final image size
|
|
||||||
- **Leverage build cache** with proper COPY order
|
|
||||||
- **Run as non-root user** in production
|
|
||||||
|
|
||||||
### ❌ DON'T
|
|
||||||
|
|
||||||
- Don't use `:latest` tag in production (be explicit)
|
|
||||||
- Don't install packages globally if local works
|
|
||||||
- Don't copy `node_modules` (let the build install them)
|
|
||||||
- Don't skip `.dockerignore` (keeps builds fast)
|
|
||||||
|
|
||||||
### 🔒 Security Tips
|
|
||||||
|
|
||||||
```dockerfile
|
|
||||||
# Example: Production-hardened Dockerfile
|
|
||||||
FROM registry.gitlab.com/hosttoday/ht-docker-node:alpine-node
|
|
||||||
|
|
||||||
# Create non-root user
|
|
||||||
RUN addgroup -g 1001 -S nodejs && adduser -S nodejs -u 1001
|
RUN addgroup -g 1001 -S nodejs && adduser -S nodejs -u 1001
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install deps as root
|
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
RUN pnpm install --frozen-lockfile && pnpm cache clean
|
RUN pnpm install --frozen-lockfile && pnpm cache clean
|
||||||
|
|
||||||
# Copy source
|
|
||||||
COPY --chown=nodejs:nodejs . .
|
COPY --chown=nodejs:nodejs . .
|
||||||
|
|
||||||
# Build
|
|
||||||
RUN pnpm build
|
RUN pnpm build
|
||||||
|
|
||||||
# Switch to non-root user
|
|
||||||
USER nodejs
|
USER nodejs
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
CMD ["node", "dist/index.js"]
|
CMD ["node", "dist/index.js"]
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 🐛 Troubleshooting
|
## 🔧 NVM Cheat Sheet
|
||||||
|
|
||||||
### NVM command not found
|
|
||||||
|
|
||||||
If NVM isn't available in your script:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Manually source NVM (shouldn't be needed in our images)
|
# Install a specific version
|
||||||
export NVM_DIR="/usr/local/nvm"
|
nvm install 22.5.0
|
||||||
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
|
|
||||||
|
# Use a version (current shell)
|
||||||
|
nvm use 22
|
||||||
|
|
||||||
|
# Set default (persists across shells / RUN steps)
|
||||||
|
nvm alias default 22
|
||||||
|
|
||||||
|
# Install and switch to latest LTS
|
||||||
|
nvm install --lts && nvm use --lts
|
||||||
|
|
||||||
|
# List installed versions
|
||||||
|
nvm ls
|
||||||
|
|
||||||
|
# Chain in a single Dockerfile RUN
|
||||||
|
RUN nvm install 22 && nvm use 22 && npm ci && npm test
|
||||||
```
|
```
|
||||||
|
|
||||||
### Alpine native module build failures
|
---
|
||||||
|
|
||||||
Some npm packages need build tools:
|
## 🏗️ Building the Images
|
||||||
|
|
||||||
```dockerfile
|
This project uses [@git.zone/tsdocker](https://code.foss.global/git.zone/tsdocker) for Docker image management.
|
||||||
FROM registry.gitlab.com/hosttoday/ht-docker-node:alpine-node
|
|
||||||
|
|
||||||
# Install build dependencies
|
```bash
|
||||||
RUN apk add --no-cache python3 make g++
|
# Install tsdocker
|
||||||
|
pnpm install -g @git.zone/tsdocker@latest
|
||||||
|
|
||||||
# Now install your packages
|
# Discover all Dockerfiles and their tags
|
||||||
RUN pnpm install
|
tsdocker list
|
||||||
|
|
||||||
|
# Build all images (multi-arch: amd64 + arm64)
|
||||||
|
tsdocker build
|
||||||
|
|
||||||
|
# Run all test scripts
|
||||||
|
tsdocker test
|
||||||
|
|
||||||
|
# Push to a specific registry
|
||||||
|
tsdocker push code.foss.global
|
||||||
```
|
```
|
||||||
|
|
||||||
### Permission denied errors
|
### Manual Build (single image)
|
||||||
|
|
||||||
```dockerfile
|
```bash
|
||||||
# Fix ownership before switching users
|
docker buildx build \
|
||||||
COPY --chown=node:node . .
|
--platform linux/amd64,linux/arm64 \
|
||||||
USER node
|
-f Dockerfile_alpine-node \
|
||||||
|
-t your-registry/your-image:alpine-node \
|
||||||
|
--push .
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Image Dependency Chain
|
||||||
|
|
||||||
|
Some images depend on others being in the registry first:
|
||||||
|
|
||||||
|
```
|
||||||
|
Dockerfile (:latest) ──► Dockerfile_lts (:lts)
|
||||||
|
──► Dockerfile_szci (:szci)
|
||||||
|
──► Dockerfile_fossglobal_preinstalled_* (:fossglobal_preinstalled_<ver>)
|
||||||
|
|
||||||
|
Dockerfile_alpine-node (:alpine-node)
|
||||||
|
──► Dockerfile_alpine-szci (:alpine-szci)
|
||||||
|
```
|
||||||
|
|
||||||
|
The standalone Alpine images (`:alpine-bun`, `:alpine-deno`) have no registry dependencies.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 📊 Image Comparison
|
## 📊 Image Comparison
|
||||||
|
|
||||||
| Feature | Ubuntu `:latest` | Alpine `:alpine-node` |
|
| Feature | Ubuntu `:latest` | Alpine `:alpine-node` |
|
||||||
|---------|------------------|----------------------|
|
|---------|------------------|----------------------|
|
||||||
| Base Size | ~800MB | ~200MB |
|
| Base Size | ~900 MB | ~200 MB |
|
||||||
| Build Tools | ✅ Full | ⚠️ Install separately |
|
| Build Tools | ✅ Full (gcc, g++, make, python3) | ⚠️ Install separately (`apk add build-base`) |
|
||||||
| Compatibility | ✅ Maximum | ✅ Good (musl) |
|
| Chromium | ✅ Pre-installed | ❌ |
|
||||||
| Multi-arch | ❌ amd64 only | ✅ amd64, arm64 |
|
| MongoDB | ✅ 8.0 | ❌ |
|
||||||
| Security | ✅ Good | ✅ Excellent (smaller surface) |
|
| Runtimes | Node + Bun + Deno + pnpm | Node + pnpm |
|
||||||
| Speed | Fast | Faster (smaller) |
|
| Compatibility | ✅ Maximum (glibc) | ✅ Good (musl) |
|
||||||
| Use Case | Complex builds | Production, CI/CD |
|
| Multi-arch | ✅ amd64, arm64 | ✅ amd64, arm64 |
|
||||||
|
| tini init | ✅ | ✅ |
|
||||||
|
| Best for | Complex builds, E2E tests, full-stack dev | Production, CI/CD, microservices |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 🔗 Useful Links
|
## 🐛 Troubleshooting
|
||||||
|
|
||||||
- **GitHub Repository:** https://github.com/HostToday/ht-docker-node
|
### NVM command not found
|
||||||
- **Docker Hub:** registry.gitlab.com/hosttoday/ht-docker-node
|
|
||||||
- **NVM Documentation:** https://github.com/nvm-sh/nvm
|
Shouldn't happen in our images, but if it does:
|
||||||
- **Alpine Linux:** https://alpinelinux.org/
|
|
||||||
- **Node.js Unofficial Builds:** https://unofficial-builds.nodejs.org/ (musl support)
|
```bash
|
||||||
|
export NVM_DIR="/usr/local/nvm"
|
||||||
|
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Alpine native module build failures
|
||||||
|
|
||||||
|
Some npm packages require native build tools:
|
||||||
|
|
||||||
|
```dockerfile
|
||||||
|
FROM code.foss.global/host.today/ht-docker-node:alpine-node
|
||||||
|
RUN apk add --no-cache python3 make g++
|
||||||
|
RUN pnpm install
|
||||||
|
```
|
||||||
|
|
||||||
|
Or use `:alpine-szci` which ships with build tools pre-installed.
|
||||||
|
|
||||||
|
### Version not persisting across RUN steps
|
||||||
|
|
||||||
|
Each Dockerfile `RUN` creates a new shell. Use `nvm alias default`:
|
||||||
|
|
||||||
|
```dockerfile
|
||||||
|
RUN nvm install 22 && nvm alias default 22
|
||||||
|
RUN node -v # ✅ v22.x.x
|
||||||
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 📋 Changelog
|
## 🔗 Links
|
||||||
|
|
||||||
See [changelog.md](changelog.md) for detailed version history.
|
- **Source Code:** [code.foss.global/host.today/ht-docker-node](https://code.foss.global/host.today/ht-docker-node)
|
||||||
|
- **NVM:** [github.com/nvm-sh/nvm](https://github.com/nvm-sh/nvm)
|
||||||
**Latest Updates (v5.0.148):**
|
- **tini:** [github.com/krallin/tini](https://github.com/krallin/tini)
|
||||||
- ✨ Multi-architecture Alpine images (amd64 + arm64)
|
- **tsdocker:** [code.foss.global/git.zone/tsdocker](https://code.foss.global/git.zone/tsdocker)
|
||||||
- ✨ Native Deno support via Alpine edge
|
- **Alpine Linux:** [alpinelinux.org](https://alpinelinux.org/)
|
||||||
- ✨ Bun runtime integration
|
- **Node.js Unofficial Builds:** [unofficial-builds.nodejs.org](https://unofficial-builds.nodejs.org/) (musl support)
|
||||||
- ✨ Simplified image tags (`:alpine-node` vs `:alpine-x64-node`)
|
|
||||||
- 🚀 docker buildx integration for cross-platform builds
|
|
||||||
- 📦 pnpm preinstalled on Alpine Node image
|
|
||||||
- 🔧 NVM 0.40.1 with improved Alpine/musl support
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## License and Legal Information
|
## License and Legal Information
|
||||||
|
|
||||||
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
|
This repository contains open-source code licensed under the MIT License. A copy of the license can be found in the [LICENSE](./LICENSE) file.
|
||||||
|
|
||||||
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
|
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
### Trademarks
|
### Trademarks
|
||||||
|
|
||||||
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.
|
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH or third parties, and are not included within the scope of the MIT license granted herein.
|
||||||
|
|
||||||
|
Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines or the guidelines of the respective third-party owners, and any usage must be approved in writing. Third-party trademarks used herein are the property of their respective owners and used only in a descriptive manner, e.g. for an implementation of an API or similar.
|
||||||
|
|
||||||
### Company Information
|
### Company Information
|
||||||
|
|
||||||
Task Venture Capital GmbH
|
Task Venture Capital GmbH
|
||||||
Registered at District court Bremen HRB 35230 HB, Germany
|
Registered at District Court Bremen HRB 35230 HB, Germany
|
||||||
|
|
||||||
For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
|
For any legal inquiries or further information, please contact us via email at hello@task.vc.
|
||||||
|
|
||||||
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
|
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
|
||||||
|
|||||||
@@ -1,83 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
echo "🧪 Testing Multi-Architecture Alpine Docker Images"
|
|
||||||
echo "==================================================="
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
# Color codes
|
|
||||||
GREEN='\033[0;32m'
|
|
||||||
BLUE='\033[0;34m'
|
|
||||||
YELLOW='\033[1;33m'
|
|
||||||
RED='\033[0;31m'
|
|
||||||
NC='\033[0m' # No Color
|
|
||||||
|
|
||||||
FAILED_TESTS=0
|
|
||||||
|
|
||||||
# Test function
|
|
||||||
test_image() {
|
|
||||||
local tag=$1
|
|
||||||
local description=$2
|
|
||||||
local test_cmd=$3
|
|
||||||
|
|
||||||
echo -e "${BLUE}🧪 Testing: ${NC}${description}"
|
|
||||||
echo -e "${YELLOW} Tag: ${NC}${tag}"
|
|
||||||
|
|
||||||
if docker run --rm "${tag}" bash -c "${test_cmd}"; then
|
|
||||||
echo -e "${GREEN}✅ Pass${NC}"
|
|
||||||
echo ""
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
echo -e "${RED}❌ Fail${NC}"
|
|
||||||
echo ""
|
|
||||||
((FAILED_TESTS++))
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Test Alpine Images (Native Platform)
|
|
||||||
echo -e "${BLUE}════════════════════════════════════════${NC}"
|
|
||||||
echo -e "${BLUE}Testing Alpine Images (Native Platform)${NC}"
|
|
||||||
echo -e "${BLUE}════════════════════════════════════════${NC}"
|
|
||||||
echo ""
|
|
||||||
echo -e "${YELLOW}💡 These images are built for your native architecture${NC}"
|
|
||||||
echo -e "${YELLOW} They will run at full native speed without emulation${NC}"
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
test_image "ht-docker-node:alpine-node" \
|
|
||||||
"Alpine with Node.js LTS + NVM + pnpm" \
|
|
||||||
"nvm --version && node --version && pnpm --version"
|
|
||||||
|
|
||||||
test_image "ht-docker-node:alpine-deno" \
|
|
||||||
"Alpine with Node.js LTS + NVM + Deno" \
|
|
||||||
"nvm --version && node --version && deno --version"
|
|
||||||
|
|
||||||
test_image "ht-docker-node:alpine-bun" \
|
|
||||||
"Alpine with Node.js LTS + NVM + Bun" \
|
|
||||||
"nvm --version && node --version && bun --version"
|
|
||||||
|
|
||||||
# Test NVM version switching (critical feature)
|
|
||||||
echo -e "${BLUE}════════════════════════════════════════${NC}"
|
|
||||||
echo -e "${BLUE}Testing NVM Version Switching${NC}"
|
|
||||||
echo -e "${BLUE}════════════════════════════════════════${NC}"
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
test_image "ht-docker-node:alpine-node" \
|
|
||||||
"NVM version switching" \
|
|
||||||
"node --version && nvm install 18 && node --version | grep v18"
|
|
||||||
|
|
||||||
# Summary
|
|
||||||
echo -e "${BLUE}════════════════════════════════════════${NC}"
|
|
||||||
if [ $FAILED_TESTS -eq 0 ]; then
|
|
||||||
echo -e "${GREEN}✨ All Tests Passed! (0 failures)${NC}"
|
|
||||||
echo -e "${BLUE}════════════════════════════════════════${NC}"
|
|
||||||
echo ""
|
|
||||||
echo -e "${YELLOW}💡 In production, these same images will work natively on both amd64 and arm64${NC}"
|
|
||||||
echo ""
|
|
||||||
exit 0
|
|
||||||
else
|
|
||||||
echo -e "${RED}❌ Some Tests Failed (${FAILED_TESTS} failures)${NC}"
|
|
||||||
echo -e "${BLUE}════════════════════════════════════════${NC}"
|
|
||||||
echo ""
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
18
test/test_alpine-bun.sh
Executable file
18
test/test_alpine-bun.sh
Executable file
@@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "Testing alpine-bun image..."
|
||||||
|
|
||||||
|
# Test NVM
|
||||||
|
echo "Testing NVM..."
|
||||||
|
nvm --version
|
||||||
|
|
||||||
|
# Test Node.js
|
||||||
|
echo "Testing Node.js..."
|
||||||
|
node --version
|
||||||
|
|
||||||
|
# Test Bun
|
||||||
|
echo "Testing Bun..."
|
||||||
|
bun --version
|
||||||
|
|
||||||
|
echo "alpine-bun tests passed!"
|
||||||
18
test/test_alpine-deno.sh
Executable file
18
test/test_alpine-deno.sh
Executable file
@@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "Testing alpine-deno image..."
|
||||||
|
|
||||||
|
# Test NVM
|
||||||
|
echo "Testing NVM..."
|
||||||
|
nvm --version
|
||||||
|
|
||||||
|
# Test Node.js
|
||||||
|
echo "Testing Node.js..."
|
||||||
|
node --version
|
||||||
|
|
||||||
|
# Test Deno
|
||||||
|
echo "Testing Deno..."
|
||||||
|
deno --version
|
||||||
|
|
||||||
|
echo "alpine-deno tests passed!"
|
||||||
24
test/test_alpine-node.sh
Executable file
24
test/test_alpine-node.sh
Executable file
@@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "Testing alpine-node image..."
|
||||||
|
|
||||||
|
# Test NVM
|
||||||
|
echo "Testing NVM..."
|
||||||
|
nvm --version
|
||||||
|
|
||||||
|
# Test Node.js
|
||||||
|
echo "Testing Node.js..."
|
||||||
|
node --version
|
||||||
|
|
||||||
|
# Test pnpm
|
||||||
|
echo "Testing pnpm..."
|
||||||
|
pnpm --version
|
||||||
|
|
||||||
|
# Test NVM version switching
|
||||||
|
echo "Testing NVM version switching..."
|
||||||
|
nvm install 18
|
||||||
|
nvm use 18
|
||||||
|
node --version | grep v18
|
||||||
|
|
||||||
|
echo "alpine-node tests passed!"
|
||||||
@@ -1 +1,32 @@
|
|||||||
echo "this runs within latest container!";
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "Testing latest image..."
|
||||||
|
|
||||||
|
# Test NVM
|
||||||
|
echo "Testing NVM..."
|
||||||
|
nvm --version
|
||||||
|
|
||||||
|
# Test Node.js
|
||||||
|
echo "Testing Node.js..."
|
||||||
|
node --version
|
||||||
|
|
||||||
|
# Test pnpm
|
||||||
|
echo "Testing pnpm..."
|
||||||
|
pnpm --version
|
||||||
|
|
||||||
|
# Test Bun
|
||||||
|
echo "Testing Bun..."
|
||||||
|
bun --version
|
||||||
|
|
||||||
|
# Test Deno
|
||||||
|
echo "Testing Deno..."
|
||||||
|
deno --version
|
||||||
|
|
||||||
|
# Test NVM version switching
|
||||||
|
echo "Testing NVM version switching..."
|
||||||
|
nvm install 22
|
||||||
|
nvm use 22
|
||||||
|
node --version | grep v22
|
||||||
|
|
||||||
|
echo "latest tests passed!"
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
# check if npmci is available
|
|
||||||
npm init -y
|
|
||||||
npmci -v
|
|
||||||
|
|
||||||
# TODO update npmci to not require package.json
|
|
||||||
npmci node install stable
|
|
||||||
|
|
||||||
# check if npm picks it up
|
|
||||||
npmci command pnpm install -g @gitzone/tsrun
|
|
||||||
npmci command tsrun -v
|
|
||||||
@@ -1,3 +1,6 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
# npm
|
# npm
|
||||||
npm -v
|
npm -v
|
||||||
node -v
|
node -v
|
||||||
|
|||||||
13
test/test_szci.sh
Normal file
13
test/test_szci.sh
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# check if szci is available
|
||||||
|
npm init -y
|
||||||
|
szci -v
|
||||||
|
|
||||||
|
# TODO update szci to not require package.json
|
||||||
|
szci node install stable
|
||||||
|
|
||||||
|
# check if npm picks it up
|
||||||
|
szci command pnpm install -g @gitzone/tsrun
|
||||||
|
szci command tsrun -v
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"experimentalDecorators": true,
|
|
||||||
"useDefineForClassFields": false,
|
|
||||||
"target": "ES2022",
|
|
||||||
"module": "NodeNext",
|
|
||||||
"moduleResolution": "NodeNext",
|
|
||||||
"esModuleInterop": true,
|
|
||||||
"verbatimModuleSyntax": true
|
|
||||||
},
|
|
||||||
"exclude": [
|
|
||||||
"dist_*/**/*.d.ts"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user