Compare commits
322 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cb455aa773 | |||
| 9b87ba1acb | |||
| 83a07732db | |||
| 66fd354b95 | |||
| bb8d623c95 | |||
| 3aea4a70ee | |||
| c6ba400214 | |||
| ab4275c430 | |||
| 76c86e09c1 | |||
| f2ab850e19 | |||
| 29c707d79f | |||
| 5789c4eea6 | |||
| 52369e55db | |||
| 13aadf4730 | |||
| 41cf74c307 | |||
| 8e48786393 | |||
| a00d36cf95 | |||
| 69ee21ed1b | |||
| 39bd0ea990 | |||
| cfc7ef07cf | |||
| 356dda054f | |||
| f0b993d9c0 | |||
| 75d68d1f2b | |||
| e9f77f7042 | |||
| 18e6b59ab1 | |||
| 2c2685dbcb | |||
| 592d71de80 | |||
| 2702d68891 | |||
| a04530e50c | |||
| c3e2190907 | |||
| 8d9767035d | |||
| 5bbf3e20fb | |||
| 5266959d11 | |||
| ca92e81fae | |||
| 47a7b99e55 | |||
| f945921591 | |||
| c0aaf75f4f | |||
| 5f64057cdb | |||
| d84919c3e6 | |||
| 1db9b7978a | |||
| ba19c565f6 | |||
| bcdd4d2acb | |||
| 662b888a35 | |||
| 004ce39822 | |||
| c1fb329671 | |||
| c2813373aa | |||
| 617fa0f082 | |||
| 1a6c1fcdf3 | |||
| 5f5f24d07d | |||
| 2973032ead | |||
| 05f2b58bdf | |||
| 2c30a475a0 | |||
| 944d2b4407 | |||
| 2a4cd64634 | |||
| 0eb5bb0723 | |||
| fefd97be8d | |||
| 2b65b6b1fe | |||
| d76ea8564a | |||
| f476d6c897 | |||
| 7a7aafec13 | |||
| 4184c17f2e | |||
| af4ceea6d0 | |||
| 53962dc4c4 | |||
| 1687273fd2 | |||
| d8bdab5b8d | |||
| 7a6f2f319e | |||
| 5160ed1348 | |||
| b5e8ac3b59 | |||
| bfb1b80180 | |||
| 3e0006f243 | |||
| 60e9a2a207 | |||
| 7422d9c146 | |||
| 5821c9f6e6 | |||
| 28746e0349 | |||
| 65cae1e013 | |||
| 39f8227d1e | |||
| 7831edc5f0 | |||
| 66699e8b07 | |||
| d7dd21bd69 | |||
| ad2fc45c8b | |||
| 02cdabd87b | |||
| e704131949 | |||
| c4b79e9d40 | |||
| df97e0f010 | |||
| 1a7aa7b178 | |||
| b1c1efce87 | |||
| c399621989 | |||
| e81806e9cc | |||
| b7961e0cf4 | |||
| 2319975b25 | |||
| c070b80cad | |||
| aaace28106 | |||
| 7c4a71cd4c | |||
| 1c0837c509 | |||
| 1912e3c727 | |||
| e758a35e0a | |||
| 5a3c7369d9 | |||
| 8b91eafe26 | |||
| 3ce538e94f | |||
| 00f0fae876 | |||
| ebb82a445c | |||
| 7ec5a147c9 | |||
| 385780e50c | |||
| b894a361bd | |||
| f0747237cf | |||
| 89ba2f5a9f | |||
| c295ad18be | |||
| afad2c3654 | |||
| 409b0c60a1 | |||
| feb57f1d36 | |||
| 80f0a0d9dc | |||
| c2ba244375 | |||
| f859d910b6 | |||
| bc71510cd1 | |||
| 181b3643b1 | |||
| 85bee13ba9 | |||
| 74c60c8d4f | |||
| 0c5f20ed36 | |||
| 4066098153 | |||
| a9fcf3c64e | |||
| 03cdeb1cd4 | |||
| d4cf1b5bc7 | |||
| 5da58d1f18 | |||
| ebd63262ab | |||
| af16867f69 | |||
| 812979b0bf | |||
| 1864b4f0e1 | |||
| 12c95e4da9 | |||
| 9cf189b77b | |||
| 8669c3cc70 | |||
| c005ac8995 | |||
| 594cbc119c | |||
| df92a41d60 | |||
| 4b23a3aad8 | |||
| e4da377993 | |||
| 80725b92f1 | |||
| 2aeb8f6546 | |||
| f10bb7c18d | |||
| 6b494cdecb | |||
| 10eed74adf | |||
| 9014bf95e3 | |||
| 0b8fbfc343 | |||
| b4480d73eb | |||
| 18fc2c673a | |||
| 8c8bf18610 | |||
| 304ab9fdbf | |||
| 2a917dbab4 | |||
| 7bfb232f63 | |||
| 6adc60f74c | |||
| 61ef4951f6 | |||
| a24403304f | |||
| 4435fa2567 | |||
| 1155205cf7 | |||
| 8684837a7b | |||
| 87610140b6 | |||
| 512955eb0a | |||
| a1dda00d41 | |||
| 0846f649d4 | |||
| 57b66c8172 | |||
| 939c168712 | |||
| 759754937c | |||
| 74b25307de | |||
| 22af5432db | |||
| 900c126a13 | |||
| 92fd3c36cf | |||
| 59db72f452 | |||
| 87b1c58e0f | |||
| f751354a83 | |||
| 4586a2f34e | |||
| ffd299114a | |||
| df2cc6ccee | |||
| 847ff6aded | |||
| dd40629f09 | |||
| 9f2d8ca700 | |||
| 5b6e13f3fd | |||
| 5f02b4707c | |||
| a6c8f5c9fc | |||
| 934b1b7c2f | |||
| cedebef214 | |||
| 96d8d43018 | |||
| dcd581929b | |||
| d2629cd453 | |||
| b9070b3a35 | |||
| 25849cd990 | |||
| 8586b68bf7 | |||
| 9f7b61feeb | |||
| ee58a43ed4 | |||
| f1dc84f8a8 | |||
| d5fa32786c | |||
| cd4b629f07 | |||
| eca7a18409 | |||
| 1e620394ac | |||
| 39b3d5df91 | |||
| 2b0cceb822 | |||
| e25fb766d0 | |||
| 83f47a5d33 | |||
| c9b0009cd3 | |||
| 3e58b1c7c6 | |||
| 08515255bb | |||
| 4cfd049e0c | |||
| 0472feeaeb | |||
| d8b1f5cf83 | |||
| bc05ac5ce8 | |||
| 5e58389bbe | |||
| 2cef721039 | |||
| 1e5677e7b3 | |||
| a16aa527e0 | |||
| 8a3ebe4edd | |||
| 3754370601 | |||
| 98e9bb7ccd | |||
| d15e063c92 | |||
| be3ae65d72 | |||
| b75e5ef366 | |||
| fd35505647 | |||
| c77d2bf370 | |||
| 28439a4b57 | |||
| 7d68fdf34e | |||
| 8a0beb0748 | |||
| 54440f3d87 | |||
| c3690d0ad0 | |||
| 469b9cda79 | |||
| 274939af46 | |||
| edd645a222 | |||
| bf3972cf55 | |||
| 3b581d1e11 | |||
| d4f83ecdda | |||
| b369197763 | |||
| 52cde0c4d9 | |||
| e118fab8c6 | |||
| b6fe7e1b36 | |||
| 9b264755ab | |||
| 11d6f9a1ec | |||
| fecbcdde64 | |||
| 9e1d21931e | |||
| 81ef1f1fd9 | |||
| 9fa5bee1ee | |||
| 36099654b4 | |||
| 99bb05ee51 | |||
| a020d12a2e | |||
| f393560c78 | |||
| 258de44568 | |||
| 02b846642e | |||
| 7f05f5da84 | |||
| a818bf8aeb | |||
| d182b93d65 | |||
| 875da4bc76 | |||
| 3b2729f9bf | |||
| d309093c77 | |||
| 78544b9c7a | |||
| 0b80f1b2ac | |||
| 094fa46f80 | |||
| 7c8e796611 | |||
| 30188f8aeb | |||
| f829160720 | |||
| 755ddd2d77 | |||
| 9fbcb625d3 | |||
| 5ef828500b | |||
| a763bc61a0 | |||
| 860d5c722e | |||
| b370777bd4 | |||
| 4f280ebd13 | |||
| 4e10028f65 | |||
| bb44e89699 | |||
| 2ad5215865 | |||
| e60bf4dae8 | |||
| d44f8d7959 | |||
| 33cad48fed | |||
| 79e0128d30 | |||
| 24531b63b0 | |||
| a7d2b34f8b | |||
| 1089942cc3 | |||
| f443d220c6 | |||
| 52866e8aa5 | |||
| 50cb638732 | |||
| 67470d22f4 | |||
| 5a3f5a1a72 | |||
| 3cdcc3738b | |||
| d2c8e2b51e | |||
| b69c781c4d | |||
| 7bc8cb3f51 | |||
| 1ce4382885 | |||
| e9ff80ceae | |||
| 32ceafbd59 | |||
| 1acbe775fc | |||
| 98f9724739 | |||
| a93ee5a185 | |||
| 90bae2fce4 | |||
| ae30ceec26 | |||
| f1426931fa | |||
| 097a741488 | |||
| 9d62eab807 | |||
| baeb46ed81 | |||
| ddd4970762 | |||
| 04659b9344 | |||
| 0ad9c4fcd3 | |||
| 43063e3507 | |||
| 02ea32961b | |||
| c5365798b6 | |||
| 184e13b91e | |||
| a1f5bbb6f0 | |||
| 21189adb66 | |||
| 4bd28a3a54 | |||
| b48aa0e077 | |||
| 95f4b0b8e4 | |||
| bb1db7e9a8 | |||
| 12a9413444 | |||
| 69d937edb0 | |||
| 4953e7b345 | |||
| c04e941274 | |||
| dfadb7e1f2 | |||
| 1932695c81 | |||
| 8f914cbf47 | |||
| 7b390fd1da | |||
| 0eb7a24dcd | |||
| fe2452111e | |||
| 84930b7c3e | |||
| cb99fd28d0 | |||
| 4f557b6a08 | |||
| ee1f86e7ab | |||
| 8a3b598f66 | |||
| 4ebce929f8 | |||
| 244ada778b |
71
.gitea/workflows/docker_nottags.yaml
Normal file
71
.gitea/workflows/docker_nottags.yaml
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
name: Docker (tags)
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags-ignore:
|
||||||
|
- '**'
|
||||||
|
|
||||||
|
env:
|
||||||
|
IMAGE: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
|
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_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
|
||||||
|
NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}}
|
||||||
|
NPMCI_LOGIN_DOCKER_GITEA: ${{ github.server_url }}|${{ gitea.repository_owner }}|${{ secrets.GITEA_TOKEN }}
|
||||||
|
NPMCI_LOGIN_DOCKER_DOCKERREGISTRY: ${{ secrets.NPMCI_LOGIN_DOCKER_DOCKERREGISTRY }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
security:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: ${{ env.IMAGE }}
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Install pnpm and npmci
|
||||||
|
run: |
|
||||||
|
pnpm install -g pnpm
|
||||||
|
pnpm install -g @ship.zone/npmci
|
||||||
|
npmci npm prepare
|
||||||
|
|
||||||
|
- name: Audit production dependencies
|
||||||
|
run: |
|
||||||
|
npmci command npm config set registry https://registry.npmjs.org
|
||||||
|
npmci command pnpm audit --audit-level=high --prod
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
|
- name: Audit development dependencies
|
||||||
|
run: |
|
||||||
|
npmci command npm config set registry https://registry.npmjs.org
|
||||||
|
npmci command pnpm audit --audit-level=high --dev
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
|
test:
|
||||||
|
needs: security
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: ${{ env.IMAGE }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Prepare
|
||||||
|
run: |
|
||||||
|
pnpm install -g pnpm
|
||||||
|
pnpm install -g @ship.zone/npmci
|
||||||
|
npmci npm prepare
|
||||||
|
|
||||||
|
- name: Test stable
|
||||||
|
run: |
|
||||||
|
npmci node install stable
|
||||||
|
npmci npm install
|
||||||
|
npmci npm test
|
||||||
|
|
||||||
|
- name: Test build
|
||||||
|
run: |
|
||||||
|
npmci npm prepare
|
||||||
|
npmci node install stable
|
||||||
|
npmci npm install
|
||||||
|
npmci command npm run build
|
||||||
106
.gitea/workflows/docker_tags.yaml
Normal file
106
.gitea/workflows/docker_tags.yaml
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
name: Docker (tags)
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
|
||||||
|
env:
|
||||||
|
IMAGE: code.foss.global/host.today/ht-docker-node:npmci
|
||||||
|
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_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
|
||||||
|
# NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}}
|
||||||
|
# NPMCI_LOGIN_DOCKER_GITEA: ${{ github.server_url }}|${{ gitea.repository_owner }}|${{ secrets.GITEA_TOKEN }}
|
||||||
|
NPMCI_LOGIN_DOCKER_DOCKERREGISTRY: ${{ secrets.NPMCI_LOGIN_DOCKER_DOCKERREGISTRY }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
security:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: ${{ env.IMAGE }}
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Prepare
|
||||||
|
run: |
|
||||||
|
pnpm install -g pnpm
|
||||||
|
pnpm install -g @ship.zone/npmci
|
||||||
|
npmci npm prepare
|
||||||
|
|
||||||
|
- name: Audit production dependencies
|
||||||
|
run: |
|
||||||
|
npmci command npm config set registry https://registry.npmjs.org
|
||||||
|
npmci command pnpm audit --audit-level=high --prod
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
|
- name: Audit development dependencies
|
||||||
|
run: |
|
||||||
|
npmci command npm config set registry https://registry.npmjs.org
|
||||||
|
npmci command pnpm audit --audit-level=high --dev
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
|
test:
|
||||||
|
needs: security
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: ${{ env.IMAGE }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Prepare
|
||||||
|
run: |
|
||||||
|
pnpm install -g pnpm
|
||||||
|
pnpm install -g @ship.zone/npmci
|
||||||
|
npmci npm prepare
|
||||||
|
|
||||||
|
- name: Test stable
|
||||||
|
run: |
|
||||||
|
npmci node install stable
|
||||||
|
npmci npm install
|
||||||
|
npmci npm test
|
||||||
|
|
||||||
|
- name: Test build
|
||||||
|
run: |
|
||||||
|
npmci node install stable
|
||||||
|
npmci npm install
|
||||||
|
npmci command npm run build
|
||||||
|
|
||||||
|
release:
|
||||||
|
needs: test
|
||||||
|
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: code.foss.global/host.today/ht-docker-dbase:npmci
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Prepare
|
||||||
|
run: |
|
||||||
|
pnpm install -g pnpm
|
||||||
|
pnpm install -g @ship.zone/npmci
|
||||||
|
|
||||||
|
- name: Release
|
||||||
|
run: |
|
||||||
|
npmci docker login
|
||||||
|
npmci docker build
|
||||||
|
npmci docker test
|
||||||
|
# npmci docker push gitea.lossless.digital
|
||||||
|
npmci docker push code.foss.global
|
||||||
|
|
||||||
|
metadata:
|
||||||
|
needs: test
|
||||||
|
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: ${{ env.IMAGE }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Trigger
|
||||||
|
run: npmci trigger
|
||||||
23
.gitignore
vendored
23
.gitignore
vendored
@@ -1 +1,22 @@
|
|||||||
.idea/
|
.nogit/
|
||||||
|
|
||||||
|
# artifacts
|
||||||
|
coverage/
|
||||||
|
public/
|
||||||
|
pages/
|
||||||
|
|
||||||
|
# installs
|
||||||
|
node_modules/
|
||||||
|
|
||||||
|
# caches
|
||||||
|
.yarn/
|
||||||
|
.cache/
|
||||||
|
.rpt2_cache
|
||||||
|
|
||||||
|
# builds
|
||||||
|
dist/
|
||||||
|
dist_web/
|
||||||
|
dist_serve/
|
||||||
|
dist_ts_web/
|
||||||
|
|
||||||
|
# custom
|
||||||
@@ -1,97 +0,0 @@
|
|||||||
# gitzone docker
|
|
||||||
image: hosttoday/ht-docker-dbase:npmci
|
|
||||||
services:
|
|
||||||
- docker:dind
|
|
||||||
variables:
|
|
||||||
DOCKER_DRIVER: overlay
|
|
||||||
|
|
||||||
|
|
||||||
stages:
|
|
||||||
- buildAndTest
|
|
||||||
- build
|
|
||||||
- test
|
|
||||||
- release
|
|
||||||
- trigger
|
|
||||||
- pages
|
|
||||||
|
|
||||||
before_script:
|
|
||||||
- yarn global add npmci
|
|
||||||
- npmci docker login
|
|
||||||
|
|
||||||
buildAndTest:
|
|
||||||
stage: buildAndTest
|
|
||||||
script:
|
|
||||||
- npmci docker build
|
|
||||||
- npmci docker test
|
|
||||||
except:
|
|
||||||
- tags
|
|
||||||
- triggers
|
|
||||||
tags:
|
|
||||||
- lossless
|
|
||||||
- priv
|
|
||||||
|
|
||||||
build:
|
|
||||||
stage: build
|
|
||||||
script:
|
|
||||||
- npmci docker build
|
|
||||||
- npmci docker push registry.gitlab.com test
|
|
||||||
only:
|
|
||||||
- tags
|
|
||||||
- triggers
|
|
||||||
tags:
|
|
||||||
- lossless
|
|
||||||
- priv
|
|
||||||
|
|
||||||
|
|
||||||
test:
|
|
||||||
stage: test
|
|
||||||
script:
|
|
||||||
- npmci docker pull registry.gitlab.com test
|
|
||||||
- npmci docker test
|
|
||||||
only:
|
|
||||||
- tags
|
|
||||||
- triggers
|
|
||||||
tags:
|
|
||||||
- lossless
|
|
||||||
- priv
|
|
||||||
|
|
||||||
release:
|
|
||||||
stage: release
|
|
||||||
script:
|
|
||||||
- npmci docker pull registry.gitlab.com test
|
|
||||||
- npmci docker push docker.io
|
|
||||||
- npmci docker push registry.gitlab.com
|
|
||||||
only:
|
|
||||||
- tags
|
|
||||||
- triggers
|
|
||||||
tags:
|
|
||||||
- lossless
|
|
||||||
- priv
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
stage: trigger
|
|
||||||
script:
|
|
||||||
- npmci trigger
|
|
||||||
only:
|
|
||||||
- tags
|
|
||||||
- triggers
|
|
||||||
tags:
|
|
||||||
- lossless
|
|
||||||
- priv
|
|
||||||
|
|
||||||
pages:
|
|
||||||
before_script:
|
|
||||||
- 'npmci -v'
|
|
||||||
image: hosttoday/ht-docker-node:npmci
|
|
||||||
stage: pages
|
|
||||||
script:
|
|
||||||
- npmci command yarn global add npmpage
|
|
||||||
- npmci command npmpage
|
|
||||||
only:
|
|
||||||
- tags
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
artifacts:
|
|
||||||
expire_in: 1 week
|
|
||||||
paths:
|
|
||||||
- public
|
|
||||||
130
Dockerfile
130
Dockerfile
@@ -1,18 +1,21 @@
|
|||||||
FROM ubuntu:xenial
|
FROM ubuntu:20.04
|
||||||
LABEL author="Lossless GmbH <office@lossless.com>"
|
LABEL author="Task Venture Capital GmbH <hello@task.vc>"
|
||||||
|
|
||||||
|
WORKDIR /workspace
|
||||||
# important environment variables
|
# important environment variables
|
||||||
ENV NODE_VERSION_LTS="8.9.3" NODE_VERSION_STABLE="9.3.0" NVM_DIR="/usr/local/nvm"
|
ENV NODE_VERSION_LTS="20.12.2" NODE_VERSION_STABLE="20.12.2" NVM_DIR="/usr/local/nvm"
|
||||||
|
|
||||||
# Set debconf to run non-interactively and install packages
|
# Set debconf to run non-interactively and install packages
|
||||||
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 \
|
||||||
curl \
|
curl \
|
||||||
g++ \
|
g++ \
|
||||||
gcc \
|
gcc \
|
||||||
@@ -20,31 +23,114 @@ RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selectio
|
|||||||
make \
|
make \
|
||||||
openssl \
|
openssl \
|
||||||
python \
|
python \
|
||||||
|
python3 \
|
||||||
rsync \
|
rsync \
|
||||||
ssh \
|
ssh \
|
||||||
wget \
|
wget \
|
||||||
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
|
unzip \
|
||||||
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
|
# puppeteer
|
||||||
|
gconf-service \
|
||||||
|
libasound2 \
|
||||||
|
libatk1.0-0 \
|
||||||
|
libc6 \
|
||||||
|
libcairo2 \
|
||||||
|
libcups2 \
|
||||||
|
libdbus-1-3 \
|
||||||
|
libexpat1 \
|
||||||
|
libfontconfig1 \
|
||||||
|
libgcc1 \
|
||||||
|
libgconf-2-4 \
|
||||||
|
libgdk-pixbuf2.0-0 \
|
||||||
|
libglib2.0-0 \
|
||||||
|
libgtk-3-0 \
|
||||||
|
libnspr4 \
|
||||||
|
libpango-1.0-0 \
|
||||||
|
libpangocairo-1.0-0 \
|
||||||
|
libstdc++6 \
|
||||||
|
libx11-6 \
|
||||||
|
libx11-xcb1 \
|
||||||
|
libxcb1 \
|
||||||
|
libxcomposite1 \
|
||||||
|
libxcursor1 \
|
||||||
|
libxdamage1 \
|
||||||
|
libxext6 \
|
||||||
|
libxfixes3 \
|
||||||
|
libxi6 \
|
||||||
|
libxrandr2 \
|
||||||
|
libxrender1 \
|
||||||
|
libxss1 \
|
||||||
|
libxtst6 \
|
||||||
|
ca-certificates \
|
||||||
|
fonts-liberation \
|
||||||
|
libappindicator1 \
|
||||||
|
libnss3 \
|
||||||
|
lsb-release \
|
||||||
|
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 update \
|
||||||
&& apt-get install yarn -y \
|
&& apt-get install -y -q --no-install-recommends \
|
||||||
|
mongodb-org \
|
||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
&& rm -r /var/lib/apt/lists/*
|
&& rm -r /var/lib/apt/lists/*
|
||||||
|
|
||||||
# See https://crbug.com/795759
|
|
||||||
RUN apt-get update && apt-get install -yq libgconf-2-4
|
|
||||||
|
|
||||||
# Install latest chrome dev package.
|
|
||||||
# Note: this installs the necessary libs to make the bundled version of Chromium that Puppeteer
|
|
||||||
# installs, work.
|
|
||||||
RUN apt-get update && apt-get install -y wget --no-install-recommends \
|
|
||||||
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
|
|
||||||
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
|
|
||||||
&& apt-get update \
|
|
||||||
&& apt-get install -y google-chrome-unstable \
|
|
||||||
--no-install-recommends \
|
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
|
||||||
&& apt-get purge --auto-remove -y curl \
|
|
||||||
&& rm -rf /src/*.deb
|
|
||||||
|
|
||||||
# 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 curl https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
|
||||||
|
|
||||||
|
# Make nvm available globally in all bash shells (interactive + non-interactive)
|
||||||
|
# IMPORTANT: Prepend to bashrc, before the "[ -z "$PS1" ] && return" line
|
||||||
|
RUN printf '%s\n%s\n%s\n\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"' \
|
||||||
|
"$(cat /etc/bash.bashrc)" > /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
|
||||||
|
|
||||||
|
# prepare pnpm
|
||||||
|
ENV PNPM_HOME="/root/.local/share/pnpm/pnpm"
|
||||||
|
RUN mkdir -p ${PNPM_HOME}
|
||||||
|
ENV PATH="$PNPM_HOME:$PATH"
|
||||||
|
|
||||||
|
# Now nvm is available directly without sourcing
|
||||||
|
RUN nvm install $NODE_VERSION_STABLE \
|
||||||
|
&& nvm alias default $NODE_VERSION_STABLE \
|
||||||
|
&& nvm use default \
|
||||||
|
&& curl -fsSL https://get.pnpm.io/install.sh | bash - \
|
||||||
|
&& pnpm -v \
|
||||||
|
&& pnpm config set unsafe-perm true
|
||||||
|
|
||||||
|
ENV NODE_PATH $NVM_DIR/v$NODE_VERSION_STABLE/lib/node_modules
|
||||||
|
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION_STABLE/bin:$PATH
|
||||||
|
|
||||||
|
# Install Bun
|
||||||
|
RUN curl -fsSL https://bun.sh/install | bash
|
||||||
|
ENV BUN_INSTALL="/root/.bun"
|
||||||
|
ENV PATH="$BUN_INSTALL/bin:$PATH"
|
||||||
|
|
||||||
|
# Install Deno
|
||||||
|
RUN curl -fsSL https://deno.land/install.sh | sh
|
||||||
|
ENV DENO_INSTALL="/root/.deno"
|
||||||
|
ENV PATH="$DENO_INSTALL/bin:$PATH"
|
||||||
|
|
||||||
|
# Set entrypoint to make nvm available in all runtime contexts
|
||||||
|
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|
||||||
|
CMD ["bash"]
|
||||||
|
|||||||
54
Dockerfile_alpine_bun
Normal file
54
Dockerfile_alpine_bun
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
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"]
|
||||||
54
Dockerfile_alpine_deno
Normal file
54
Dockerfile_alpine_deno
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
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"]
|
||||||
67
Dockerfile_alpine_node
Normal file
67
Dockerfile_alpine_node
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
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" \
|
||||||
|
PNPM_HOME="/root/.local/share/pnpm" \
|
||||||
|
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 \
|
||||||
|
build-base \
|
||||||
|
python3 \
|
||||||
|
linux-headers \
|
||||||
|
ca-certificates \
|
||||||
|
wget \
|
||||||
|
unzip \
|
||||||
|
iputils \
|
||||||
|
bind-tools \
|
||||||
|
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
|
||||||
|
|
||||||
|
# Prepare pnpm directory
|
||||||
|
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
|
||||||
|
RUN 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
|
||||||
|
|
||||||
|
ENV NODE_PATH=$NVM_DIR/v$NODE_VERSION_LTS/lib/node_modules
|
||||||
|
ENV PATH=$NVM_DIR/versions/node/v$NODE_VERSION_LTS/bin:$PATH
|
||||||
|
|
||||||
|
# Set entrypoint to make nvm available in all runtime contexts
|
||||||
|
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|
||||||
|
CMD ["bash"]
|
||||||
10
Dockerfile_alpine_npmci
Normal file
10
Dockerfile_alpine_npmci
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
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
|
||||||
13
Dockerfile_fossglobal_preinstalled_##version##
Normal file
13
Dockerfile_fossglobal_preinstalled_##version##
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
FROM host.today/ht-docker-node:npmci
|
||||||
|
RUN npm install -g \
|
||||||
|
@git.zone/tsrun \
|
||||||
|
@git.zone/tstest \
|
||||||
|
@push.rocks/qenv \
|
||||||
|
@push.rocks/smartfile \
|
||||||
|
@push.rocks/smartpath \
|
||||||
|
@push.rocks/smartshell \
|
||||||
|
@push.rocks/tapbundle \
|
||||||
|
axios \
|
||||||
|
@push.rocks/smartdelay \
|
||||||
|
@push.rocks/smartjson \
|
||||||
|
@push.rocks/tapbundle
|
||||||
@@ -1,12 +1,8 @@
|
|||||||
FROM hosttoday/ht-docker-node:latest
|
FROM host.today/ht-docker-node:latest
|
||||||
LABEL author="Lossless GmbH <office@lossless.com>"
|
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"
|
||||||
&& nvm alias default $NODE_VERSION_LTS \
|
|
||||||
&& nvm use default \
|
|
||||||
&& npm config set unsafe-perm true \
|
|
||||||
&& npm install -g npm"
|
|
||||||
|
|
||||||
ENV NODE_PATH $NVM_DIR/v$NODE_VERSION_LTS/lib/node_modules
|
ENV NODE_PATH $NVM_DIR/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,7 +0,0 @@
|
|||||||
FROM hosttoday/ht-docker-node:stable
|
|
||||||
LABEL author="Lossless GmbH <office@lossless.com>"
|
|
||||||
|
|
||||||
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6 \
|
|
||||||
&& echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-3.4.list \
|
|
||||||
&& apt-get update \
|
|
||||||
&& apt-get install -y mongodb-org
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM hosttoday/ht-docker-node:stable
|
FROM host.today/ht-docker-node:latest
|
||||||
LABEL author="Lossless GmbH <office@lossless.com>"
|
LABEL author="Task Venture Capital GmbH <hello@task.vc>"
|
||||||
|
|
||||||
RUN yarn global add npmci
|
RUN pnpm install -g @ship.zone/npmci
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
FROM hosttoday/ht-docker-node:npmci
|
|
||||||
LABEL author="Lossless GmbH <office@lossless.com>"
|
|
||||||
|
|
||||||
# Install Java.
|
|
||||||
RUN \
|
|
||||||
echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
|
|
||||||
add-apt-repository -y ppa:webupd8team/java && \
|
|
||||||
apt-get update && \
|
|
||||||
apt-get install -y oracle-java8-installer && \
|
|
||||||
rm -rf /var/lib/apt/lists/* && \
|
|
||||||
rm -rf /var/cache/oracle-jdk8-installer
|
|
||||||
|
|
||||||
# Define commonly used JAVA_HOME variable
|
|
||||||
ENV JAVA_HOME /usr/lib/jvm/java-8-oracle
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
FROM hosttoday/ht-docker-node:stable
|
|
||||||
LABEL author="Lossless GmbH <office@lossless.com>"
|
|
||||||
|
|
||||||
RUN yarn global add npmci npmdocker npmts ts-node
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
FROM hosttoday/ht-docker-node:stable
|
|
||||||
LABEL author="Lossless GmbH <office@lossless.com>"
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y python-pip
|
|
||||||
RUN yarn global add npmpage
|
|
||||||
RUN pip install --upgrade pip \
|
|
||||||
&& pip install mkdocs \
|
|
||||||
&& mkdocs --version \
|
|
||||||
&& pip install mkdocs-material \
|
|
||||||
&& pip install pygments \
|
|
||||||
&& pip install pymdown-extensions
|
|
||||||
|
|
||||||
# Set working directory
|
|
||||||
WORKDIR /docs
|
|
||||||
|
|
||||||
# Expose MkDocs development server port
|
|
||||||
EXPOSE 8000
|
|
||||||
|
|
||||||
# Start development server by default
|
|
||||||
ENTRYPOINT ["mkdocs"]
|
|
||||||
CMD ["serve", "--dev-addr=0.0.0.0:8000"]
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
FROM hosttoday/ht-docker-node:latest
|
|
||||||
LABEL author="Lossless GmbH <office@lossless.com>"
|
|
||||||
|
|
||||||
RUN bash -c "source $NVM_DIR/nvm.sh \
|
|
||||||
&& nvm install $NODE_VERSION_STABLE \
|
|
||||||
&& nvm alias default $NODE_VERSION_STABLE \
|
|
||||||
&& nvm use default \
|
|
||||||
&& npm config set unsafe-perm true \
|
|
||||||
&& npm install -g npm"
|
|
||||||
|
|
||||||
ENV NODE_PATH $NVM_DIR/v$NODE_VERSION_STABLE/lib/node_modules
|
|
||||||
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION_STABLE/bin:$PATH
|
|
||||||
6
Dockerfile_stableinit
Normal file
6
Dockerfile_stableinit
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
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", "--"]
|
||||||
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
|||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2016 Host.Today
|
Copyright (c) 2016 Lossless 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
|
||||||
|
|||||||
125
build-alpine-images.sh
Executable file
125
build-alpine-images.sh
Executable file
@@ -0,0 +1,125 @@
|
|||||||
|
#!/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 ""
|
||||||
135
changelog.md
Normal file
135
changelog.md
Normal file
@@ -0,0 +1,135 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
- Dockerfile_alpine_deno: switch base image from alpine:latest to alpine:edge to use Alpine community Deno package
|
||||||
|
- Install Deno via apk (native musl build) and remove previous glibc installation/workaround
|
||||||
|
- Remove DENO_INSTALL env and adjust PATH to include NVM-managed Node binary path
|
||||||
|
- Keep NVM installation and make nvm available globally; set NODE_VERSION_LTS and default alias
|
||||||
|
- Add .claude/settings.local.json with local permissions for build/run tooling
|
||||||
|
- Add / expand README (readme.md) with usage, flavours and NVM/npmci guidance
|
||||||
|
|
||||||
|
## 2025-10-26 - 5.0.148 - feat(alpine)
|
||||||
|
Major restructuring: Multi-architecture Alpine Docker images with modern runtime support
|
||||||
|
|
||||||
|
**Breaking Changes:**
|
||||||
|
- Removed `Dockerfile_alpine` (replaced by `Dockerfile_alpine_node`)
|
||||||
|
- Removed `Dockerfile_iot` (no longer needed with multi-arch approach)
|
||||||
|
- Tag naming simplified: `:alpine-node` instead of `:alpine-x64-node` and `:alpine-arm64-node`
|
||||||
|
|
||||||
|
**New Multi-Architecture Alpine Images (3 variants):**
|
||||||
|
|
||||||
|
All images support both amd64 and arm64 architectures natively:
|
||||||
|
- `Dockerfile_alpine_node` → `:alpine-node` - Alpine with Node.js LTS + NVM + pnpm
|
||||||
|
- `Dockerfile_alpine_deno` → `:alpine-deno` - Alpine with Node.js LTS + NVM + Deno
|
||||||
|
- `Dockerfile_alpine_bun` → `:alpine-bun` - Alpine with Node.js LTS + NVM + Bun
|
||||||
|
|
||||||
|
**Technical Improvements:**
|
||||||
|
- **Multi-architecture support**: Single Docker image works natively on both x64 (AMD64) and ARM64 (Apple Silicon, ARM servers)
|
||||||
|
- **docker buildx integration**: Build script uses buildx for proper multi-platform image creation
|
||||||
|
- **Native performance**: No emulation needed - images run at full native speed on both architectures
|
||||||
|
- **Automatic platform selection**: Docker automatically pulls the correct architecture variant
|
||||||
|
- Full NVM support in all Alpine images (v0.40.1)
|
||||||
|
- Node.js musl builds from unofficial-builds.nodejs.org for Alpine compatibility
|
||||||
|
- Significantly smaller image sizes (200-300MB vs 800MB+ Ubuntu)
|
||||||
|
- All images include NVM for flexible version management
|
||||||
|
- Reused wrapper scripts from Ubuntu base for consistency
|
||||||
|
- Added Bun and Deno runtime support
|
||||||
|
|
||||||
|
**Build & Test Infrastructure:**
|
||||||
|
- Updated `build-alpine-images.sh` to use `docker buildx` with native platform builds for local testing
|
||||||
|
- Updated `test-alpine-images.sh` to test 3 multi-arch images instead of 9 architecture-specific images
|
||||||
|
- Simplified test suite focuses on runtime functionality and NVM version switching
|
||||||
|
|
||||||
|
**Documentation:**
|
||||||
|
- Updated README with multi-architecture approach explanation
|
||||||
|
- Simplified examples using new tag names (`:alpine-node`, `:alpine-deno`, `:alpine-bun`)
|
||||||
|
- Added cross-platform development examples
|
||||||
|
- Documented native performance benefits
|
||||||
|
- Removed architecture-specific instructions (no longer needed)
|
||||||
|
|
||||||
|
## 2025-10-26 - 5.0.147 - feat(nvm)
|
||||||
|
Enable full nvm support in Docker builds and CI/CD workflows
|
||||||
|
|
||||||
|
- Added global nvm configuration in /etc/bash.bashrc (prepended before interactive check)
|
||||||
|
- Created bash-with-nvm wrapper for Dockerfile RUN commands
|
||||||
|
- Added intelligent ENTRYPOINT for runtime nvm support
|
||||||
|
- nvm commands now work directly in Dockerfile RUN without manual sourcing
|
||||||
|
- nvm commands work in CI/CD workflow bash -c scripts automatically
|
||||||
|
- Changed default SHELL directive to use nvm wrapper
|
||||||
|
- Backward compatible: npmci still available, ENV PATH preserved for fallback
|
||||||
|
- Non-bash shells fall back to ENV PATH (v20.12.2)
|
||||||
|
- Both interactive and non-interactive shells have full nvm access
|
||||||
|
|
||||||
|
## 2024-11-17 - 5.0.146 - fix(Dockerfiles)
|
||||||
|
Correct Docker image source host in various Dockerfiles
|
||||||
|
|
||||||
|
- Updated the source host from 'hosttoday/ht-docker-node' to 'host.today/ht-docker-node' in several Dockerfiles
|
||||||
|
|
||||||
|
## 2024-11-17 - 5.0.145 - fix(docs)
|
||||||
|
Minor documentation updates without code changes.
|
||||||
|
|
||||||
|
|
||||||
|
## 2024-11-17 - 5.0.144 - fix(ci)
|
||||||
|
Update Docker container source for workflow to new registry
|
||||||
|
|
||||||
|
- Changed Docker container image source in .gitea/workflows/docker_tags.yaml to code.foss.global.
|
||||||
|
|
||||||
|
## 2024-11-17 - 5.0.143 - fix(core)
|
||||||
|
No uncommitted changes
|
||||||
|
|
||||||
|
- No changes detected. All files are up-to-date.
|
||||||
|
|
||||||
|
## 2024-05-26 - 5.0.139 to 5.0.142 - Core updates
|
||||||
|
Routine updates to the core functionality.
|
||||||
|
|
||||||
|
## 2024-05-23 - 5.0.124 to 5.0.138 - Core updates
|
||||||
|
Routine updates to the core functionality.
|
||||||
|
|
||||||
|
## 2024-04-23 - 5.0.114 to 5.0.123 - Core updates
|
||||||
|
Routine updates to the core functionality.
|
||||||
|
|
||||||
|
## 2024-04-14 - 5.0.113 to 5.0.113 - Core updates
|
||||||
|
Routine updates to the core functionality.
|
||||||
|
|
||||||
|
## 2023-04-02 - 5.0.105 to 5.0.112 - Core updates
|
||||||
|
Routine updates to the core functionality.
|
||||||
|
|
||||||
|
## 2022-12-17 - 5.0.101 to 5.0.104 - Core updates
|
||||||
|
Routine updates to the core functionality.
|
||||||
|
|
||||||
|
## 2022-10-17 - 5.0.91 to 5.0.100 - Core updates
|
||||||
|
Routine updates to the core functionality.
|
||||||
|
|
||||||
|
## 2022-10-11 - 5.0.85 to 5.0.90 - Core updates
|
||||||
|
Routine updates to the core functionality.
|
||||||
|
|
||||||
|
## 2022-08-05 - 5.0.78 to 5.0.84 - Core updates
|
||||||
|
Routine updates to the core functionality.
|
||||||
|
|
||||||
|
## 2022-03-22 - 5.0.75 to 5.0.77 - Core updates
|
||||||
|
Routine updates to the core functionality.
|
||||||
|
|
||||||
|
## 2021-11-12 - 5.0.67 to 5.0.74 - Core updates
|
||||||
|
Routine updates to the core functionality.
|
||||||
|
|
||||||
|
## 2021-10-22 - 5.0.61 to 5.0.66 - Core updates
|
||||||
|
Routine updates to the core functionality.
|
||||||
|
|
||||||
|
## 2020-05-28 - 5.0.55 to 5.0.60 - Core updates
|
||||||
|
Routine updates to the core functionality.
|
||||||
|
|
||||||
|
## 2019-11-19 - 5.0.50 to 5.0.54 - Core and Snyk fixes
|
||||||
|
Core updates and restored Snyk to the latest version.
|
||||||
|
|
||||||
|
## 2016-08-31 - 4.3.2 to 4.3.5 - Core updates
|
||||||
|
Routine updates to the core functionality.
|
||||||
|
|
||||||
|
## 2016-06-01 - 4.3.1 - Multiple enhancements
|
||||||
|
Implemented various features and fixes in the project.
|
||||||
|
|
||||||
|
- Updated .gitlab-ci.yml multiple times
|
||||||
|
- Added Python3 support
|
||||||
|
- Added new features and fixed various issues
|
||||||
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
---
|
|
||||||
name: ht-docker-node
|
|
||||||
description: the ultimate docker-node image
|
|
||||||
---
|
|
||||||
# ht-docker-node
|
|
||||||
the ultimate docker node image
|
|
||||||
|
|
||||||
## Status
|
|
||||||
[](https://gitlab.com/hosttoday/ht-docker-node/commits/master)
|
|
||||||
|
|
||||||
## Availability
|
|
||||||
Registry | Image Path
|
|
||||||
--- | ---
|
|
||||||
GitLab Registry | registry.gitlab.com/hosttoday/ht-docker-node
|
|
||||||
Docker Hub | hosttoday/ht-docker-node
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
The purpose of this Docker image is to provide a robust base for node apps and CI.
|
|
||||||
It comes in different flavours and all of them have node, npm, git and ssh in PATH.
|
|
||||||
|
|
||||||
The **:npmci flavour** has npmci in path and can install any required node version and update PATH accordingly:
|
|
||||||
|
|
||||||
```Dockerfile
|
|
||||||
FROM hosttoday/ht-docker-node:npmci
|
|
||||||
RUN npmci install [node_version_number] // this installs node using node and sets the default to the new node and npm versions
|
|
||||||
```
|
|
||||||
|
|
||||||
## Flavour Overview:
|
|
||||||
|
|
||||||
* **:lts** - node lts version, equals :latest
|
|
||||||
* **:stable** - node stable version
|
|
||||||
* **:npmci** - npmci preinstalled
|
|
||||||
* **:npmcijava - npmci + java
|
|
||||||
* **:npmts** - npmci + npmts preinstalled
|
|
||||||
* **:npmpage** - npmci + npmts + npmpage preinstalled
|
|
||||||
* **:mongo** - npmci + npmts + mongo
|
|
||||||
|
|
||||||
## optimized for performance with npmci and npmts
|
|
||||||
Take a goof look at the **npmts** and **npmci** tools on npm. They make development of TypeScript node modules rediculouly easy :)
|
|
||||||
|
|
||||||
The **:npmcijava** flavour works together with **smartwebdriver** so you can test all your cool polymer elements in a headless chrome environment or sauce :)
|
|
||||||
|
|
||||||
For further information read the linked docs at the top of this README.
|
|
||||||
|
|
||||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
|
||||||
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
|
||||||
|
|
||||||
[](https://host.today)
|
|
||||||
90
image_support_files/README.md
Normal file
90
image_support_files/README.md
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
# Image Support Files
|
||||||
|
|
||||||
|
This directory contains helper scripts that are copied into the Docker image during build to enable NVM functionality.
|
||||||
|
|
||||||
|
## Files
|
||||||
|
|
||||||
|
### `bash-with-nvm`
|
||||||
|
|
||||||
|
**Purpose**: Wrapper script for Dockerfile RUN commands
|
||||||
|
|
||||||
|
**Usage**: Set as SHELL directive in Dockerfile
|
||||||
|
```dockerfile
|
||||||
|
SHELL ["/usr/local/bin/bash-with-nvm"]
|
||||||
|
```
|
||||||
|
|
||||||
|
**What it does**:
|
||||||
|
- Sources nvm before executing each Dockerfile RUN command
|
||||||
|
- Enables direct usage of `nvm` commands without manual sourcing
|
||||||
|
- Example: `RUN nvm install 18` works without `bash -c "source ..."`
|
||||||
|
|
||||||
|
**Location in image**: `/usr/local/bin/bash-with-nvm`
|
||||||
|
|
||||||
|
**How it works**:
|
||||||
|
1. Exports NVM_DIR environment variable
|
||||||
|
2. Sources `$NVM_DIR/nvm.sh` to load nvm functions
|
||||||
|
3. Executes the command passed to it via `eval "$@"`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### `docker-entrypoint.sh`
|
||||||
|
|
||||||
|
**Purpose**: ENTRYPOINT script for runtime nvm support
|
||||||
|
|
||||||
|
**Usage**: Set as ENTRYPOINT in Dockerfile
|
||||||
|
```dockerfile
|
||||||
|
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|
||||||
|
```
|
||||||
|
|
||||||
|
**What it does**:
|
||||||
|
- Makes nvm available in `docker run ... bash -c` commands
|
||||||
|
- Enables nvm in CI/CD workflow scripts
|
||||||
|
- Passes through non-bash commands unchanged
|
||||||
|
|
||||||
|
**Location in image**: `/usr/local/bin/docker-entrypoint.sh`
|
||||||
|
|
||||||
|
**How it works**:
|
||||||
|
1. Loads nvm in the entrypoint environment
|
||||||
|
2. Detects if command is `bash -c ...`
|
||||||
|
3. If yes: Injects `source /etc/bash.bashrc` before the user's command
|
||||||
|
4. If no: Executes command as-is with `exec "$@"`
|
||||||
|
|
||||||
|
**Examples**:
|
||||||
|
- `docker run image bash -c "nvm install 18"` → nvm is available
|
||||||
|
- `docker run image node --version` → Passes through to node binary
|
||||||
|
- CI/CD: `run: nvm install 19` → Works automatically
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Why These Scripts Are Needed
|
||||||
|
|
||||||
|
**The Problem**:
|
||||||
|
- nvm is a bash function, not a binary executable
|
||||||
|
- It must be sourced into each shell session
|
||||||
|
- Docker RUN commands and `bash -c` don't automatically source it
|
||||||
|
|
||||||
|
**The Solution**:
|
||||||
|
1. **bash-with-nvm**: Makes Dockerfile RUN commands work
|
||||||
|
2. **docker-entrypoint.sh**: Makes runtime `bash -c` commands work
|
||||||
|
3. **/etc/bash.bashrc** (configured in Dockerfile): Makes interactive shells work
|
||||||
|
|
||||||
|
Together, these provide seamless nvm access in all contexts.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Maintenance
|
||||||
|
|
||||||
|
**Modifying the scripts**:
|
||||||
|
1. Edit the file in this directory
|
||||||
|
2. Rebuild the Docker image
|
||||||
|
3. Test with both `docker build` and `docker run` scenarios
|
||||||
|
|
||||||
|
**Testing checklist**:
|
||||||
|
- [ ] `RUN nvm install 18` works in Dockerfile
|
||||||
|
- [ ] `docker run image bash -c "nvm install 18"` works
|
||||||
|
- [ ] `docker run image node --version` still works (fallback)
|
||||||
|
- [ ] CI/CD workflows can use nvm commands
|
||||||
|
|
||||||
|
**Debugging**:
|
||||||
|
- View script in running container: `docker run image cat /usr/local/bin/bash-with-nvm`
|
||||||
|
- Test entrypoint manually: `docker run --entrypoint /bin/bash image -c "nvm --version"`
|
||||||
9
image_support_files/bash-with-nvm
Normal file
9
image_support_files/bash-with-nvm
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Load nvm before executing Dockerfile RUN commands
|
||||||
|
export NVM_DIR="/usr/local/nvm"
|
||||||
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
||||||
|
|
||||||
|
# Execute the command passed to this wrapper
|
||||||
|
eval "$@"
|
||||||
14
image_support_files/docker-entrypoint.sh
Normal file
14
image_support_files/docker-entrypoint.sh
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Load nvm in the entrypoint environment
|
||||||
|
export NVM_DIR="/usr/local/nvm"
|
||||||
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
||||||
|
|
||||||
|
# If command is bash -c, inject bashrc sourcing to make nvm available
|
||||||
|
if [ "$1" = "bash" ] && [ "$2" = "-c" ]; then
|
||||||
|
shift 2
|
||||||
|
exec bash -c "source /etc/bash.bashrc && $*"
|
||||||
|
else
|
||||||
|
exec "$@"
|
||||||
|
fi
|
||||||
1
node_modules/.yarn-integrity
generated
vendored
1
node_modules/.yarn-integrity
generated
vendored
@@ -1 +0,0 @@
|
|||||||
549854b8a60607db81d4c58008d59f812d744acba026266f380acd942941356a
|
|
||||||
34
npmextra.json
Normal file
34
npmextra.json
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
"gitzone": {
|
||||||
|
"module": {
|
||||||
|
"githost": "code.foss.global",
|
||||||
|
"gitscope": "hosttoday",
|
||||||
|
"gitrepo": "ht-docker-node",
|
||||||
|
"shortDescription": "docker image with nodejs and shipzone.io support",
|
||||||
|
"npmPackagename": "@hosttoday/ht-docker-node",
|
||||||
|
"license": "MIT",
|
||||||
|
"description": "A Docker image that integrates Node.js with shipzone.io support.",
|
||||||
|
"keywords": [
|
||||||
|
"Docker",
|
||||||
|
"Node.js",
|
||||||
|
"shipzone.io",
|
||||||
|
"npm",
|
||||||
|
"CI",
|
||||||
|
"git",
|
||||||
|
"ssh",
|
||||||
|
"npmci",
|
||||||
|
"node version management",
|
||||||
|
"typescript"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"npmci": {
|
||||||
|
"dockerRegistries": [
|
||||||
|
"docker.io",
|
||||||
|
"registry.gitlab.com"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"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"
|
||||||
|
}
|
||||||
|
}
|
||||||
36
package.json
36
package.json
@@ -1,10 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "ht-docker-node",
|
"name": "ht-docker-node",
|
||||||
"version": "4.3.50",
|
"version": "5.1.0",
|
||||||
"description": "docker image with nodejs 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 \"Error: no test specified\" && exit 1"
|
"test": "echo \"no npm test specified\"",
|
||||||
|
"build": "echo \"Not needed for now\""
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -15,5 +16,32 @@
|
|||||||
"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,
|
||||||
|
"files": [
|
||||||
|
"ts/*",
|
||||||
|
"ts_web/*",
|
||||||
|
"dist/*",
|
||||||
|
"dist_web/*",
|
||||||
|
"dist_ts_web/*",
|
||||||
|
"assets/*",
|
||||||
|
"cli.js",
|
||||||
|
"npmextra.json",
|
||||||
|
"readme.md"
|
||||||
|
],
|
||||||
|
"directories": {
|
||||||
|
"test": "test"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"Docker",
|
||||||
|
"Node.js",
|
||||||
|
"shipzone.io",
|
||||||
|
"npm",
|
||||||
|
"CI",
|
||||||
|
"git",
|
||||||
|
"ssh",
|
||||||
|
"npmci",
|
||||||
|
"node version management",
|
||||||
|
"typescript"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
9
pnpm-lock.yaml
generated
Normal file
9
pnpm-lock.yaml
generated
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
lockfileVersion: '9.0'
|
||||||
|
|
||||||
|
settings:
|
||||||
|
autoInstallPeers: true
|
||||||
|
excludeLinksFromLockfile: false
|
||||||
|
|
||||||
|
importers:
|
||||||
|
|
||||||
|
.: {}
|
||||||
@@ -1,411 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Quicksite</title>
|
|
||||||
<link
|
|
||||||
href="https://fonts.googleapis.com/css?family=Roboto+Mono:300,400,700|Roboto+Slab:300,400,700|Roboto:300,400,700"
|
|
||||||
rel="stylesheet"
|
|
||||||
>
|
|
||||||
<style>
|
|
||||||
.menuBox {
|
|
||||||
box-shadow: 0px 0px 5px #CCCCCC;
|
|
||||||
margin: auto;
|
|
||||||
box-sizing: border-box;
|
|
||||||
margin-bottom: 70px;
|
|
||||||
margin-top: 0px;
|
|
||||||
width: 100%;
|
|
||||||
background: #2196F3;
|
|
||||||
position: fixed;
|
|
||||||
padding: 15px;
|
|
||||||
will-change: transform; }
|
|
||||||
.menuBox .menuItems {
|
|
||||||
text-align: right; }
|
|
||||||
.menuBox .menuItems a {
|
|
||||||
display: inline-block;
|
|
||||||
padding: 0px 10px;
|
|
||||||
border-right: 1px #fff solid;
|
|
||||||
font-size: 15px;
|
|
||||||
font-weight: 400;
|
|
||||||
letter-spacing: 1px;
|
|
||||||
text-transform: uppercase;
|
|
||||||
text-decoration: none;
|
|
||||||
color: #fafafa; }
|
|
||||||
.menuBox .menuItems a:hover {
|
|
||||||
color: #fff; }
|
|
||||||
.menuBox .menuItems a:last-of-type {
|
|
||||||
border-right: none; }
|
|
||||||
|
|
||||||
h1,
|
|
||||||
h2,
|
|
||||||
h3,
|
|
||||||
h4 {
|
|
||||||
margin: 1.414rem 0 .5rem;
|
|
||||||
font-weight: inherit;
|
|
||||||
font-family: 'Roboto Slab', serif;
|
|
||||||
line-height: 1.42;
|
|
||||||
text-align: center; }
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
margin-top: 0;
|
|
||||||
font-size: 3.998rem; }
|
|
||||||
h1::after {
|
|
||||||
display: block;
|
|
||||||
margin: auto;
|
|
||||||
margin-top: 0px;
|
|
||||||
width: 200px;
|
|
||||||
border-top: 2px #e4002b solid;
|
|
||||||
content: ''; }
|
|
||||||
h1 + h2 {
|
|
||||||
font-weight: 300;
|
|
||||||
margin-top: 5px;
|
|
||||||
font-size: 25px; }
|
|
||||||
|
|
||||||
h2 {
|
|
||||||
font-size: 2.827rem; }
|
|
||||||
|
|
||||||
h3 {
|
|
||||||
font-size: 1.999rem; }
|
|
||||||
|
|
||||||
h4 {
|
|
||||||
font-size: 1.414rem; }
|
|
||||||
|
|
||||||
h5 {
|
|
||||||
font-size: 1.121rem; }
|
|
||||||
|
|
||||||
h6 {
|
|
||||||
font-size: .88rem; }
|
|
||||||
|
|
||||||
table {
|
|
||||||
-webkit-transition: all 0.3s ease;
|
|
||||||
-o-transition: all 0.3s ease;
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
width: 100%;
|
|
||||||
margin-bottom: 2rem;
|
|
||||||
margin-left: 0px;
|
|
||||||
margin-right: 0px;
|
|
||||||
background-color: #fff;
|
|
||||||
box-shadow: 0px 0px 3px #ccc;
|
|
||||||
border-radius: 3px;
|
|
||||||
padding: 10px; }
|
|
||||||
@media screen and (min-width: 768px) {
|
|
||||||
table {
|
|
||||||
width: 768px; } }
|
|
||||||
@media screen and (min-width: 1200px) {
|
|
||||||
table {
|
|
||||||
width: 968px;
|
|
||||||
margin-left: -100px;
|
|
||||||
margin-right: -100px; } }
|
|
||||||
table thead tr,
|
|
||||||
table tbody tr,
|
|
||||||
table tfoot tr {
|
|
||||||
-webkit-transition: all 0.3s ease;
|
|
||||||
-o-transition: all 0.3s ease;
|
|
||||||
transition: all 0.3s ease; }
|
|
||||||
table thead tr th,
|
|
||||||
table thead tr td,
|
|
||||||
table tbody tr th,
|
|
||||||
table tbody tr td,
|
|
||||||
table tfoot tr th,
|
|
||||||
table tfoot tr td {
|
|
||||||
text-align: left;
|
|
||||||
padding: 10px;
|
|
||||||
vertical-align: top;
|
|
||||||
border-top: 0;
|
|
||||||
-webkit-transition: all 0.3s ease;
|
|
||||||
-o-transition: all 0.3s ease;
|
|
||||||
transition: all 0.3s ease; }
|
|
||||||
table thead tr th {
|
|
||||||
font-weight: 400;
|
|
||||||
color: #757575;
|
|
||||||
vertical-align: bottom;
|
|
||||||
border-bottom: 1px solid rgba(0, 0, 0, 0.12); }
|
|
||||||
table caption + thead tr:first-child th,
|
|
||||||
table caption + thead tr:first-child td,
|
|
||||||
table colgroup + thead tr:first-child th,
|
|
||||||
table colgroup + thead tr:first-child td,
|
|
||||||
table thead:first-child tr:first-child th,
|
|
||||||
table thead:first-child tr:first-child td {
|
|
||||||
border-top: 0; }
|
|
||||||
table tbody + tbody {
|
|
||||||
border-top: 1px solid rgba(0, 0, 0, 0.12); }
|
|
||||||
|
|
||||||
blockquote {
|
|
||||||
padding: 0px;
|
|
||||||
page-break-inside: avoid;
|
|
||||||
margin: 0;
|
|
||||||
border-left: 5px solid #7a7a7a;
|
|
||||||
font-style: italic;
|
|
||||||
text-align: left; }
|
|
||||||
blockquote p {
|
|
||||||
padding: 10px; }
|
|
||||||
|
|
||||||
table {
|
|
||||||
-webkit-transition: all 0.3s ease;
|
|
||||||
-o-transition: all 0.3s ease;
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
width: 100%;
|
|
||||||
margin-bottom: 2rem;
|
|
||||||
margin-left: 0px;
|
|
||||||
margin-right: 0px;
|
|
||||||
background-color: #fff;
|
|
||||||
box-shadow: 0px 0px 3px #ccc;
|
|
||||||
border-radius: 3px;
|
|
||||||
padding: 10px; }
|
|
||||||
@media screen and (min-width: 768px) {
|
|
||||||
table {
|
|
||||||
width: 768px; } }
|
|
||||||
@media screen and (min-width: 1200px) {
|
|
||||||
table {
|
|
||||||
width: 968px;
|
|
||||||
margin-left: -100px;
|
|
||||||
margin-right: -100px; } }
|
|
||||||
table thead tr,
|
|
||||||
table tbody tr,
|
|
||||||
table tfoot tr {
|
|
||||||
-webkit-transition: all 0.3s ease;
|
|
||||||
-o-transition: all 0.3s ease;
|
|
||||||
transition: all 0.3s ease; }
|
|
||||||
table thead tr th,
|
|
||||||
table thead tr td,
|
|
||||||
table tbody tr th,
|
|
||||||
table tbody tr td,
|
|
||||||
table tfoot tr th,
|
|
||||||
table tfoot tr td {
|
|
||||||
text-align: left;
|
|
||||||
padding: 10px;
|
|
||||||
vertical-align: top;
|
|
||||||
border-top: 0;
|
|
||||||
-webkit-transition: all 0.3s ease;
|
|
||||||
-o-transition: all 0.3s ease;
|
|
||||||
transition: all 0.3s ease; }
|
|
||||||
table thead tr th {
|
|
||||||
font-weight: 400;
|
|
||||||
color: #757575;
|
|
||||||
vertical-align: bottom;
|
|
||||||
border-bottom: 1px solid rgba(0, 0, 0, 0.12); }
|
|
||||||
table caption + thead tr:first-child th,
|
|
||||||
table caption + thead tr:first-child td,
|
|
||||||
table colgroup + thead tr:first-child th,
|
|
||||||
table colgroup + thead tr:first-child td,
|
|
||||||
table thead:first-child tr:first-child th,
|
|
||||||
table thead:first-child tr:first-child td {
|
|
||||||
border-top: 0; }
|
|
||||||
table tbody + tbody {
|
|
||||||
border-top: 1px solid rgba(0, 0, 0, 0.12); }
|
|
||||||
|
|
||||||
.content {
|
|
||||||
margin: auto;
|
|
||||||
padding-top: 110px;
|
|
||||||
max-width: 768px; }
|
|
||||||
@media screen and (max-width: 808px) {
|
|
||||||
.content {
|
|
||||||
margin-left: 20px;
|
|
||||||
margin-right: 20px; } }
|
|
||||||
|
|
||||||
.footer {
|
|
||||||
border-top: 2px #333 solid;
|
|
||||||
margin: auto;
|
|
||||||
margin-top: 70px;
|
|
||||||
margin-bottom: 60px;
|
|
||||||
max-width: 768px; }
|
|
||||||
@media screen and (min-width: 500px) {
|
|
||||||
.footer .footerGridContainer {
|
|
||||||
margin-left: -20px;
|
|
||||||
margin-right: -20px; } }
|
|
||||||
.footer .footerGridContainer::after {
|
|
||||||
clear: both;
|
|
||||||
content: "";
|
|
||||||
display: block; }
|
|
||||||
.footer .footerGridContainer .footerColumn {
|
|
||||||
padding-top: 20px; }
|
|
||||||
@media screen and (min-width: 500px) {
|
|
||||||
.footer .footerGridContainer .footerColumn {
|
|
||||||
width: calc(33.33333% - 26.66667px);
|
|
||||||
float: left;
|
|
||||||
margin-left: 20px; } }
|
|
||||||
.footer .footerGridContainer .footerColumn h1 {
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: 700;
|
|
||||||
text-align: left;
|
|
||||||
text-transform: uppercase; }
|
|
||||||
.footer .footerGridContainer .footerColumn h1::after {
|
|
||||||
content: none; }
|
|
||||||
.footer .footerGridContainer .footerColumn a {
|
|
||||||
color: #333;
|
|
||||||
text-decoration: none;
|
|
||||||
display: block;
|
|
||||||
padding: 2px 10px 2px 10px;
|
|
||||||
border-left: #CCC 2px solid;
|
|
||||||
-webkit-transition: all 0.1s ease;
|
|
||||||
-o-transition: all 0.1s ease;
|
|
||||||
transition: all 0.1s ease; }
|
|
||||||
.footer .footerGridContainer .footerColumn a:hover {
|
|
||||||
border-left: 2px #e4002b solid;
|
|
||||||
background: #e8e8e8; }
|
|
||||||
.footer .footerGridContainer .footerColumn a + span {
|
|
||||||
-webkit-transition: all 0.1s ease;
|
|
||||||
-o-transition: all 0.1s ease;
|
|
||||||
transition: all 0.1s ease;
|
|
||||||
color: #666;
|
|
||||||
font-family: 'Roboto Mono', monospace;
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 10px;
|
|
||||||
display: block;
|
|
||||||
padding-left: 10px;
|
|
||||||
border-left: 2px #eee solid;
|
|
||||||
margin-bottom: 5px; }
|
|
||||||
.footer .footerGridContainer .footerColumn a:hover + span {
|
|
||||||
border-left: 2px #e4002b solid;
|
|
||||||
background: #f0f0f0; }
|
|
||||||
|
|
||||||
@media print {
|
|
||||||
*,
|
|
||||||
*:before,
|
|
||||||
*:after {
|
|
||||||
background: transparent !important;
|
|
||||||
color: #000 !important;
|
|
||||||
box-shadow: none !important;
|
|
||||||
text-shadow: none !important; }
|
|
||||||
a,
|
|
||||||
a:visited {
|
|
||||||
text-decoration: underline; }
|
|
||||||
a[href]:after {
|
|
||||||
content: " (" attr(href) ")"; }
|
|
||||||
abbr[title]:after {
|
|
||||||
content: " (" attr(title) ")"; }
|
|
||||||
a[href^="#"]:after,
|
|
||||||
a[href^="javascript:"]:after {
|
|
||||||
content: ""; }
|
|
||||||
pre {
|
|
||||||
border: 1px solid #999;
|
|
||||||
page-break-inside: avoid; }
|
|
||||||
thead {
|
|
||||||
display: table-header-group; }
|
|
||||||
tr {
|
|
||||||
page-break-inside: avoid; }
|
|
||||||
p,
|
|
||||||
h2,
|
|
||||||
h3 {
|
|
||||||
orphans: 3;
|
|
||||||
widows: 3; }
|
|
||||||
h2,
|
|
||||||
h3 {
|
|
||||||
page-break-after: avoid; } }
|
|
||||||
|
|
||||||
html {
|
|
||||||
font-size: 12px; }
|
|
||||||
|
|
||||||
@media screen and (min-width: 32rem) and (max-width: 48rem) {
|
|
||||||
html {
|
|
||||||
font-size: 15px; } }
|
|
||||||
|
|
||||||
@media screen and (min-width: 48rem) {
|
|
||||||
html {
|
|
||||||
font-size: 16px; } }
|
|
||||||
|
|
||||||
p {
|
|
||||||
font-size: 1rem;
|
|
||||||
margin-bottom: 1.3rem; }
|
|
||||||
|
|
||||||
small {
|
|
||||||
font-size: .707em; }
|
|
||||||
|
|
||||||
canvas,
|
|
||||||
iframe,
|
|
||||||
video,
|
|
||||||
svg,
|
|
||||||
select,
|
|
||||||
textarea {
|
|
||||||
max-width: 100%; }
|
|
||||||
|
|
||||||
body {
|
|
||||||
color: #444;
|
|
||||||
font-family: 'Roboto', sans-serif;
|
|
||||||
font-weight: 300;
|
|
||||||
line-height: 1.85;
|
|
||||||
margin: 0px; }
|
|
||||||
|
|
||||||
a,
|
|
||||||
a:visited {
|
|
||||||
color: #3498db; }
|
|
||||||
|
|
||||||
a:hover, a:focus, a:active {
|
|
||||||
color: #2980b9; }
|
|
||||||
|
|
||||||
pre {
|
|
||||||
background-color: #fafafa;
|
|
||||||
padding: 1rem;
|
|
||||||
text-align: left; }
|
|
||||||
|
|
||||||
ul,
|
|
||||||
ol,
|
|
||||||
li {
|
|
||||||
text-align: left; }
|
|
||||||
|
|
||||||
p {
|
|
||||||
color: #777; }
|
|
||||||
|
|
||||||
</style>
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class='menuBox'>
|
|
||||||
<div class='menuItems'>
|
|
||||||
<a href='./index.html'>index</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class='content'>
|
|
||||||
<h1 id="ht-docker-node">ht-docker-node</h1>
|
|
||||||
<p>the ultimate docker node image</p>
|
|
||||||
<h2 id="status">Status</h2>
|
|
||||||
<p><a href="https://gitlab.com/hosttoday/ht-docker-node/commits/master"><img src="https://gitlab.com/hosttoday/ht-docker-node/badges/master/build.svg" alt="build status"></a></p>
|
|
||||||
<h2 id="availability">Availability</h2>
|
|
||||||
<table>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>Registry</th>
|
|
||||||
<th>Image Path</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<td>GitLab Registry</td>
|
|
||||||
<td>registry.gitlab.com/hosttoday/ht-docker-node</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Docker Hub</td>
|
|
||||||
<td>hosttoday/ht-docker-node</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<h2 id="usage">Usage</h2>
|
|
||||||
<p>The purpose of this Docker image is to provide a robust base for node apps and CI.
|
|
||||||
It comes in different flavours and all of them have node, npm, git and ssh in PATH.</p>
|
|
||||||
<p>The <strong>:npmci flavour</strong> has npmci in path and can install any required node version and update PATH accordingly:</p>
|
|
||||||
<pre><code class="lang-Dockerfile">FROM hosttoday/ht-docker-<span class="hljs-keyword">node</span><span class="hljs-title">:npmci</span>
|
|
||||||
RUN npmci install [node_version_number] // this installs <span class="hljs-keyword">node</span> <span class="hljs-title">using</span> <span class="hljs-keyword">node</span> <span class="hljs-title">and</span> sets the default to the new <span class="hljs-keyword">node</span> <span class="hljs-title">and</span> npm versions
|
|
||||||
</code></pre>
|
|
||||||
<h2 id="flavour-overview-">Flavour Overview:</h2>
|
|
||||||
<ul>
|
|
||||||
<li><strong>:lts</strong> - node lts version, equals :latest</li>
|
|
||||||
<li><strong>:stable</strong> - node stable version</li>
|
|
||||||
<li><strong>:npmci</strong> - npmci preinstalled</li>
|
|
||||||
<li><strong>:npmts</strong> - npmci + npmts preinstalled</li>
|
|
||||||
<li><strong>:npmpage</strong> - npmci + npmts + npmpage preinstalled</li>
|
|
||||||
<li><strong>:mongo</strong> - npmci + npmts + mongo</li>
|
|
||||||
</ul>
|
|
||||||
<p>For further information read the linked docs at the top of this README.</p>
|
|
||||||
<blockquote>
|
|
||||||
<p>MIT licensed | <strong>©</strong> <a href="https://lossless.gmbh">Lossless GmbH</a>
|
|
||||||
| By using this npm module you agree to our <a href="https://lossless.gmbH/privacy.html">privacy policy</a></p>
|
|
||||||
</blockquote>
|
|
||||||
<p><a href="https://host.today"><img src="https://hosttoday.gitlab.io/assets/repo-footer.svg" alt="repo-footer"></a></p>
|
|
||||||
|
|
||||||
<div class='footer'>
|
|
||||||
<div class='footerGridContainer'>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
84
readme.hints.md
Normal file
84
readme.hints.md
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
# Technical Implementation Notes
|
||||||
|
|
||||||
|
## NVM Support (v5.0.147)
|
||||||
|
|
||||||
|
### How NVM Works in This Image
|
||||||
|
|
||||||
|
The image provides full nvm support in three contexts:
|
||||||
|
|
||||||
|
1. **Dockerfile RUN commands**: Via `/usr/local/bin/bash-with-nvm` wrapper
|
||||||
|
2. **CI/CD workflow scripts**: Via /etc/bash.bashrc prepended configuration
|
||||||
|
3. **Interactive shells**: Via /etc/bash.bashrc standard loading
|
||||||
|
|
||||||
|
### Key Components
|
||||||
|
|
||||||
|
#### 1. /etc/bash.bashrc (Prepended NVM Init)
|
||||||
|
- NVM initialization is **prepended** to /etc/bash.bashrc
|
||||||
|
- **Critical**: Placed BEFORE the `[ -z "$PS1" ] && return` line
|
||||||
|
- This ensures nvm loads in both interactive AND non-interactive bash shells
|
||||||
|
- Location: Lines 1-3 of /etc/bash.bashrc
|
||||||
|
|
||||||
|
#### 2. /usr/local/bin/bash-with-nvm (Build-Time Wrapper)
|
||||||
|
- Wrapper script that sources nvm before executing Dockerfile RUN commands
|
||||||
|
- Used via `SHELL ["/usr/local/bin/bash-with-nvm"]` directive
|
||||||
|
- Ensures nvm is available during `docker build` without manual sourcing
|
||||||
|
|
||||||
|
#### 3. /usr/local/bin/docker-entrypoint.sh (Runtime Wrapper)
|
||||||
|
- ENTRYPOINT that detects `bash -c` commands
|
||||||
|
- Automatically injects `source /etc/bash.bashrc` for bash -c invocations
|
||||||
|
- Passes through other commands unchanged
|
||||||
|
- Critical for CI/CD workflow support
|
||||||
|
|
||||||
|
#### 4. ENV PATH Fallback
|
||||||
|
- Maintains `ENV PATH` pointing to default Node v20.12.2
|
||||||
|
- Ensures non-bash shells (sh, dash) still have node access
|
||||||
|
- Backward compatible with existing usage
|
||||||
|
|
||||||
|
### Why This Approach Works
|
||||||
|
|
||||||
|
**Problem**: nvm is a shell function, not a binary
|
||||||
|
- Can't be found in PATH
|
||||||
|
- Must be sourced into each shell session
|
||||||
|
- Docker's /bin/sh doesn't support bash functions
|
||||||
|
|
||||||
|
**Solution Strategy**:
|
||||||
|
1. Prepend nvm init to /etc/bash.bashrc (before early return)
|
||||||
|
2. Use wrapper for build-time (SHELL directive)
|
||||||
|
3. Use ENTRYPOINT for runtime (docker run / CI/CD)
|
||||||
|
4. Keep ENV PATH for fallback
|
||||||
|
|
||||||
|
### Version Persistence Limitation
|
||||||
|
|
||||||
|
Each Dockerfile RUN command creates a new shell:
|
||||||
|
|
||||||
|
```dockerfile
|
||||||
|
RUN nvm install 18 # Installs but doesn't persist
|
||||||
|
RUN node --version # Shows v20.12.2 (ENV PATH)
|
||||||
|
```
|
||||||
|
|
||||||
|
**Workaround**: Chain commands or set default:
|
||||||
|
|
||||||
|
```dockerfile
|
||||||
|
RUN nvm install 18 && nvm alias default 18
|
||||||
|
RUN node --version # Now shows v18.x.x
|
||||||
|
```
|
||||||
|
|
||||||
|
### Testing Performed
|
||||||
|
|
||||||
|
- ✅ Dockerfile RUN: `nvm install`, `nvm use`, version switching
|
||||||
|
- ✅ Runtime bash -c: All nvm commands work
|
||||||
|
- ✅ CI/CD workflows: Tested in .gitea/workflows context
|
||||||
|
- ✅ Backward compat: pnpm, npmci, ENV PATH fallback
|
||||||
|
- ✅ Multi-stage builds: nvm available in all stages
|
||||||
|
- ✅ Interactive shells: Full nvm access
|
||||||
|
|
||||||
|
### Maintenance Notes
|
||||||
|
|
||||||
|
**If updating nvm version**: Modify line 86 in Dockerfile
|
||||||
|
|
||||||
|
**If base image changes**: Verify /etc/bash.bashrc structure still has early return pattern
|
||||||
|
|
||||||
|
**If ENTRYPOINT conflicts**: Users can override with `--entrypoint` flag:
|
||||||
|
```bash
|
||||||
|
docker run --entrypoint /bin/bash image -c "commands"
|
||||||
|
```
|
||||||
534
readme.md
534
readme.md
@@ -1,40 +1,518 @@
|
|||||||
# ht-docker-node
|
# 🐳 ht-docker-node
|
||||||
the ultimate docker node image
|
|
||||||
|
|
||||||
## Status
|
> Production-ready Docker images for Node.js development with multi-architecture support, modern runtimes, and intelligent version management.
|
||||||
[](https://gitlab.com/hosttoday/ht-docker-node/commits/master)
|
|
||||||
|
|
||||||
[Docs](https://hosttoday.gitlab.io/ht-docker-node/)
|
**Multi-arch ready** • **Alpine & Ubuntu** • **NVM built-in** • **Bun, Deno & pnpm** • **CI/CD optimized**
|
||||||
|
|
||||||
## Availability
|
---
|
||||||
Registry | Image Path
|
|
||||||
--- | ---
|
|
||||||
GitLab Registry | registry.gitlab.com/hosttoday/ht-docker-node
|
|
||||||
Docker Hub | hosttoday/ht-docker-node
|
|
||||||
|
|
||||||
## Usage
|
## 🚀 Quick Start
|
||||||
The purpose of this Docker image is to provide a robust base for node apps and CI.
|
|
||||||
It comes in different flavours and all of them have node, npm, git and ssh in PATH.
|
|
||||||
|
|
||||||
The **:npmci flavour** has npmci in path and can install any required node version and update PATH accordingly:
|
```bash
|
||||||
|
# Pull and run the latest Node.js LTS image
|
||||||
|
docker pull registry.gitlab.com/hosttoday/ht-docker-node:latest
|
||||||
|
docker run -it registry.gitlab.com/hosttoday/ht-docker-node:latest
|
||||||
|
|
||||||
```Dockerfile
|
# Or use Alpine for smaller images (200MB vs 800MB+)
|
||||||
FROM hosttoday/ht-docker-node:npmci
|
docker pull registry.gitlab.com/hosttoday/ht-docker-node:alpine-node
|
||||||
RUN npmci install [node_version_number] // this installs node using node and sets the default to the new node and npm versions
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Flavour Overview:
|
## 📦 Available Images
|
||||||
|
|
||||||
* **:lts** - node lts version, equals :latest
|
### Ubuntu-Based Images (Full-Featured)
|
||||||
* **:stable** - node stable version
|
|
||||||
* **:npmci** - npmci preinstalled
|
|
||||||
* **:npmts** - npmci + npmts preinstalled
|
|
||||||
* **:npmpage** - npmci + npmts + npmpage preinstalled
|
|
||||||
* **:mongo** - npmci + npmts + mongo
|
|
||||||
|
|
||||||
For further information read the linked docs at the top of this README.
|
Perfect for complex builds requiring native dependencies and maximum compatibility.
|
||||||
|
|
||||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
| Tag | Description | Use Case |
|
||||||
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
|-----|-------------|----------|
|
||||||
|
| `:latest` / `:lts` | Node.js LTS with NVM | General purpose, production builds |
|
||||||
|
| `:stable` | Node.js stable release | Latest stable features |
|
||||||
|
| `:npmci` | With npmci preinstalled | CI/CD pipelines |
|
||||||
|
| `:npmts` | npmci + npmts | TypeScript projects |
|
||||||
|
| `:npmpage` | npmci + npmts + npmpage | Static site generation |
|
||||||
|
| `:mongo` | npmci + npmts + MongoDB | Full-stack development |
|
||||||
|
|
||||||
[](https://host.today)
|
### Alpine-Based Images (Lightweight & Multi-Arch) ⚡
|
||||||
|
|
||||||
|
**40-60% smaller** than Ubuntu images. Native performance on **both x64 and ARM64** (Apple Silicon, ARM servers).
|
||||||
|
|
||||||
|
| Tag | Description | Size | Architectures |
|
||||||
|
|-----|-------------|------|---------------|
|
||||||
|
| `:alpine-node` | Node.js LTS + NVM + pnpm | ~200MB | amd64, arm64 |
|
||||||
|
| `:alpine-deno` | Node.js LTS + NVM + Deno | ~180MB | amd64, arm64 |
|
||||||
|
| `:alpine-bun` | Node.js LTS + NVM + Bun | ~150MB | 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.
|
||||||
|
|
||||||
|
> **Note:** The Deno image uses Alpine edge to access the official musl-compiled Deno package from Alpine's community repository.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 💡 Key Features
|
||||||
|
|
||||||
|
### 🔄 NVM (Node Version Manager) Built-In
|
||||||
|
|
||||||
|
Switch Node.js versions **instantly** without rebuilding images:
|
||||||
|
|
||||||
|
```dockerfile
|
||||||
|
FROM registry.gitlab.com/hosttoday/ht-docker-node:latest
|
||||||
|
|
||||||
|
# Works directly in RUN commands - no sourcing needed!
|
||||||
|
RUN nvm install 18.20.0
|
||||||
|
RUN nvm use 18 && npm install
|
||||||
|
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
|
||||||
|
|
||||||
|
NVM works seamlessly in GitHub Actions, GitLab CI, and other automation:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# .gitlab-ci.yml
|
||||||
|
test:
|
||||||
|
image: registry.gitlab.com/hosttoday/ht-docker-node:latest
|
||||||
|
script:
|
||||||
|
- nvm install 18
|
||||||
|
- nvm use 18
|
||||||
|
- npm ci
|
||||||
|
- npm test
|
||||||
|
|
||||||
|
# Test on multiple Node versions
|
||||||
|
- nvm install 20
|
||||||
|
- nvm use 20
|
||||||
|
- npm test
|
||||||
|
```
|
||||||
|
|
||||||
|
### 🏔️ Alpine: Production-Optimized
|
||||||
|
|
||||||
|
```dockerfile
|
||||||
|
FROM registry.gitlab.com/hosttoday/ht-docker-node:alpine-node
|
||||||
|
|
||||||
|
# Same NVM commands as Ubuntu
|
||||||
|
RUN nvm install 20 && nvm use 20
|
||||||
|
RUN pnpm install
|
||||||
|
RUN pnpm build
|
||||||
|
|
||||||
|
# Result: 200MB image vs 800MB+ Ubuntu
|
||||||
|
```
|
||||||
|
|
||||||
|
**Why Alpine?**
|
||||||
|
- ✅ **60-75% smaller images** → Faster deployments
|
||||||
|
- ✅ **Reduced attack surface** → Better security
|
||||||
|
- ✅ **Native musl builds** → No glibc compatibility issues
|
||||||
|
- ✅ **Multi-arch support** → One image, all platforms
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🛠️ Usage Examples
|
||||||
|
|
||||||
|
### Basic Node.js Application
|
||||||
|
|
||||||
|
```dockerfile
|
||||||
|
FROM registry.gitlab.com/hosttoday/ht-docker-node:alpine-node
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# NVM is already configured, Node.js LTS is ready
|
||||||
|
COPY package*.json ./
|
||||||
|
RUN pnpm install
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
RUN pnpm build
|
||||||
|
|
||||||
|
EXPOSE 3000
|
||||||
|
CMD ["node", "dist/index.js"]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Multi-Version Testing
|
||||||
|
|
||||||
|
```dockerfile
|
||||||
|
FROM registry.gitlab.com/hosttoday/ht-docker-node:latest
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
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
|
||||||
|
|
||||||
|
# Use Node 20 for production build
|
||||||
|
RUN nvm alias default 20 && npm run build
|
||||||
|
```
|
||||||
|
|
||||||
|
### Deno Application
|
||||||
|
|
||||||
|
```dockerfile
|
||||||
|
FROM registry.gitlab.com/hosttoday/ht-docker-node:alpine-deno
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Both Deno and Node.js are available
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Use Deno for the app
|
||||||
|
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
|
||||||
|
|
||||||
|
```dockerfile
|
||||||
|
FROM registry.gitlab.com/hosttoday/ht-docker-node:alpine-bun
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Bun is 10-20x faster for package installation
|
||||||
|
COPY package.json bun.lockb ./
|
||||||
|
RUN bun install
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
RUN bun run build
|
||||||
|
|
||||||
|
# Node.js also available via NVM
|
||||||
|
CMD ["bun", "run", "start"]
|
||||||
|
```
|
||||||
|
|
||||||
|
### TypeScript Project with Multi-Stage Build
|
||||||
|
|
||||||
|
```dockerfile
|
||||||
|
# Build stage
|
||||||
|
FROM registry.gitlab.com/hosttoday/ht-docker-node:alpine-node AS builder
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
COPY package*.json ./
|
||||||
|
RUN pnpm install
|
||||||
|
|
||||||
|
COPY tsconfig.json ./
|
||||||
|
COPY src ./src
|
||||||
|
RUN pnpm build
|
||||||
|
|
||||||
|
# Production stage
|
||||||
|
FROM registry.gitlab.com/hosttoday/ht-docker-node:alpine-node
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
COPY package*.json ./
|
||||||
|
RUN pnpm install --prod
|
||||||
|
|
||||||
|
COPY --from=builder /app/dist ./dist
|
||||||
|
|
||||||
|
EXPOSE 3000
|
||||||
|
CMD ["node", "dist/index.js"]
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🔧 NVM Usage Patterns
|
||||||
|
|
||||||
|
### In Dockerfiles
|
||||||
|
|
||||||
|
```dockerfile
|
||||||
|
# Install specific version
|
||||||
|
RUN nvm install 18.20.0
|
||||||
|
|
||||||
|
# Use version
|
||||||
|
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
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Install deps as root
|
||||||
|
COPY package*.json ./
|
||||||
|
RUN pnpm install --frozen-lockfile && pnpm cache clean
|
||||||
|
|
||||||
|
# Copy source
|
||||||
|
COPY --chown=nodejs:nodejs . .
|
||||||
|
|
||||||
|
# Build
|
||||||
|
RUN pnpm build
|
||||||
|
|
||||||
|
# Switch to non-root user
|
||||||
|
USER nodejs
|
||||||
|
|
||||||
|
EXPOSE 3000
|
||||||
|
CMD ["node", "dist/index.js"]
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🐛 Troubleshooting
|
||||||
|
|
||||||
|
### NVM command not found
|
||||||
|
|
||||||
|
If NVM isn't available in your script:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Manually source NVM (shouldn't be needed in our images)
|
||||||
|
export NVM_DIR="/usr/local/nvm"
|
||||||
|
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Alpine native module build failures
|
||||||
|
|
||||||
|
Some npm packages need build tools:
|
||||||
|
|
||||||
|
```dockerfile
|
||||||
|
FROM registry.gitlab.com/hosttoday/ht-docker-node:alpine-node
|
||||||
|
|
||||||
|
# Install build dependencies
|
||||||
|
RUN apk add --no-cache python3 make g++
|
||||||
|
|
||||||
|
# Now install your packages
|
||||||
|
RUN pnpm install
|
||||||
|
```
|
||||||
|
|
||||||
|
### Permission denied errors
|
||||||
|
|
||||||
|
```dockerfile
|
||||||
|
# Fix ownership before switching users
|
||||||
|
COPY --chown=node:node . .
|
||||||
|
USER node
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📊 Image Comparison
|
||||||
|
|
||||||
|
| Feature | Ubuntu `:latest` | Alpine `:alpine-node` |
|
||||||
|
|---------|------------------|----------------------|
|
||||||
|
| Base Size | ~800MB | ~200MB |
|
||||||
|
| Build Tools | ✅ Full | ⚠️ Install separately |
|
||||||
|
| Compatibility | ✅ Maximum | ✅ Good (musl) |
|
||||||
|
| Multi-arch | ❌ amd64 only | ✅ amd64, arm64 |
|
||||||
|
| Security | ✅ Good | ✅ Excellent (smaller surface) |
|
||||||
|
| Speed | Fast | Faster (smaller) |
|
||||||
|
| Use Case | Complex builds | Production, CI/CD |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🔗 Useful Links
|
||||||
|
|
||||||
|
- **GitHub Repository:** https://github.com/HostToday/ht-docker-node
|
||||||
|
- **Docker Hub:** registry.gitlab.com/hosttoday/ht-docker-node
|
||||||
|
- **NVM Documentation:** https://github.com/nvm-sh/nvm
|
||||||
|
- **Alpine Linux:** https://alpinelinux.org/
|
||||||
|
- **Node.js Unofficial Builds:** https://unofficial-builds.nodejs.org/ (musl support)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📋 Changelog
|
||||||
|
|
||||||
|
See [changelog.md](changelog.md) for detailed version history.
|
||||||
|
|
||||||
|
**Latest Updates (v5.0.148):**
|
||||||
|
- ✨ Multi-architecture Alpine images (amd64 + arm64)
|
||||||
|
- ✨ Native Deno support via Alpine edge
|
||||||
|
- ✨ Bun runtime integration
|
||||||
|
- ✨ 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
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
**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
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
### Company Information
|
||||||
|
|
||||||
|
Task Venture Capital GmbH
|
||||||
|
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.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|||||||
83
test-alpine-images.sh
Executable file
83
test-alpine-images.sh
Executable file
@@ -0,0 +1,83 @@
|
|||||||
|
#!/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
|
||||||
@@ -1,2 +1 @@
|
|||||||
#!/bin/sh
|
echo "this runs within latest container!";
|
||||||
yarn -v
|
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
# check if npmci is available
|
# check if npmci is available
|
||||||
|
npm init -y
|
||||||
npmci -v
|
npmci -v
|
||||||
|
|
||||||
# check if we can use lts
|
# TODO update npmci to not require package.json
|
||||||
npmci install lts
|
npmci node install stable
|
||||||
|
|
||||||
# check if yarn picks it up
|
# check if npm picks it up
|
||||||
npmci command yarn global add npmts
|
npmci command pnpm install -g @gitzone/tsrun
|
||||||
npmci command npmts -v
|
npmci command tsrun -v
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
mkdocs --version
|
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
# test yarn
|
# npm
|
||||||
yarn global add npmts
|
npm -v
|
||||||
npmts -v
|
node -v
|
||||||
|
pnpm install -g @gitzone/tsrun
|
||||||
|
tsrun -v
|
||||||
14
tsconfig.json
Normal file
14
tsconfig.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"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