Compare commits

..

No commits in common. "master" and "v4.3.31" have entirely different histories.

30 changed files with 649 additions and 761 deletions

View File

@ -1,71 +0,0 @@
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

View File

@ -1,106 +0,0 @@
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
View File

@ -1,22 +1 @@
.nogit/
# artifacts
coverage/
public/
pages/
# installs
node_modules/
# caches
.yarn/
.cache/
.rpt2_cache
# builds
dist/
dist_web/
dist_serve/
dist_ts_web/
# custom
.idea/

96
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,96 @@
# 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
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

View File

@ -1,21 +1,18 @@
FROM ubuntu:20.04
LABEL author="Task Venture Capital GmbH <hello@task.vc>"
FROM ubuntu:latest
MAINTAINER Lossless GmbH <office@lossless.com>
WORKDIR /workspace
# important environment variables
ENV NODE_VERSION_LTS="20.12.2" NODE_VERSION_STABLE="20.12.2" NVM_DIR="/usr/local/nvm"
ENV NODE_VERSION_LTS="6.10.0" NODE_VERSION_STABLE="8.1.3" NVM_DIR="/usr/local/nvm"
# Set debconf to run non-interactively and install packages
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections \
&& apt-get update \
&& apt-get upgrade --no-install-recommends -y \
&& apt-get install -y -q --no-install-recommends \
# base libs
software-properties-common \
apt-transport-https \
build-essential \
ca-certificates \
gpg-agent \
curl \
g++ \
gcc \
@ -23,80 +20,15 @@ RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selectio
make \
openssl \
python \
python3 \
rsync \
ssh \
wget \
# 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 \
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& apt-get update \
&& apt-get install -y -q --no-install-recommends \
mongodb-org \
&& apt-get install yarn -y \
&& apt-get clean \
&& rm -r /var/lib/apt/lists/*
# Install nvm with node and npm
RUN curl https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
# prepare pnpm
ENV PNPM_HOME="/root/.local/share/pnpm/pnpm"
RUN mkdir -p ${PNPM_HOME}
ENV PATH="$PNPM_HOME:$PATH"
RUN bash -c "source $NVM_DIR/nvm.sh \
&& 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
RUN curl https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash

View File

@ -1,11 +0,0 @@
FROM node:18.15.0-alpine
LABEL author="Task Venture Capital GmbH <hello@task.vc>"
#pnpm
ENV PNPM_HOME="/root/.local/share/pnpm/pnpm"
RUN apk add --no-cache curl iputils bind-tools bash && mkdir -p ${PNPM_HOME}
ENV PATH="$PNPM_HOME:$PATH"
RUN curl -fsSL "https://github.com/pnpm/pnpm/releases/latest/download/pnpm-linuxstatic-x64" -o /bin/pnpm; chmod +x /bin/pnpm;
RUN pnpm -v
ENV NODE_OPTIONS="--max_old_space_size=1000"

View File

@ -1,10 +0,0 @@
FROM host.today/ht-docker-node:alpine
RUN apk update && apk add bash libc6-compat alpine-sdk
ENV PYTHONUNBUFFERED=1
RUN apk add --update --no-cache python3 && ln -sf python3 /usr/bin/python
RUN python3 -m ensurepip
RUN pip3 install --no-cache --upgrade pip setuptools
RUN apk add --update alpine-sdk && \
apk add libffi-dev openssl-dev && \
apk add python3-dev && \
pnpm install -g @ship.zone/npmci node-gyp

View File

@ -1,13 +0,0 @@
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

View File

@ -1,12 +0,0 @@
FROM host.today/ht-docker-node:latest as stage1
LABEL author="Task Venture Capital GmbH <hello@task.vc>"
RUN apt-get update && apt-get install -y --no-install-recommends qemu-user-static binfmt-support
# the following lines need to be run on a system that supports both architectures
# update-binfmts --enable qemu-arm \
# && update-binfmts --display qemu-arm \
# && mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc \
# && echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-static:' > /proc/sys/fs/binfmt_misc/register
FROM arm32v7/node:lts-jessie as stage2
COPY --from=stage1 /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static

View File

@ -1,8 +1,12 @@
FROM host.today/ht-docker-node:latest
LABEL author="Task Venture Capital GmbH <hello@task.vc>"
FROM hosttoday/ht-docker-node:latest
MAINTAINER Lossless GmbH <office@lossless.com>
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 PATH $NVM_DIR/versions/node/v$NODE_VERSION_LTS/bin:$PATH

7
Dockerfile_mongo Normal file
View File

@ -0,0 +1,7 @@
FROM hosttoday/ht-docker-node:stable
MAINTAINER Lossless GmbH <office@lossless.com>
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927 \
&& echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-3.2.list \
&& apt-get update \
&& apt-get install -y mongodb-org

View File

@ -1,4 +1,4 @@
FROM host.today/ht-docker-node:latest
LABEL author="Task Venture Capital GmbH <hello@task.vc>"
FROM hosttoday/ht-docker-node:stable
MAINTAINER Lossless GmbH <office@lossless.com>
RUN pnpm install -g @ship.zone/npmci
RUN npm install -g npmci

14
Dockerfile_npmcijava Normal file
View File

@ -0,0 +1,14 @@
FROM hosttoday/ht-docker-node:npmci
MAINTAINER 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

3
Dockerfile_npmcinanobox Normal file
View File

@ -0,0 +1,3 @@
FROM hosttoday/ht-docker-node:npmci
RUN bash -c "$(curl -fsSL https://s3.amazonaws.com/tools.nanobox.io/bootstrap/ci.sh)"
RUN nanobox config set ci-mode true

11
Dockerfile_stable Normal file
View File

@ -0,0 +1,11 @@
FROM hosttoday/ht-docker-node:latest
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

View File

@ -1,6 +0,0 @@
FROM host.today/ht-docker-node:latest
# Add Tini
ENV TINI_VERSION v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
ENTRYPOINT ["/tini", "--"]

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2016 Lossless GmbH
Copyright (c) 2016 Host.Today
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,73 +0,0 @@
# Changelog
## 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

48
docs/index.md Normal file
View File

@ -0,0 +1,48 @@
---
name: ht-docker-node
description: the ultimate docker-node image
---
# ht-docker-node
the ultimate docker node image
## Status
[![build status](https://gitlab.com/hosttoday/ht-docker-node/badges/master/build.svg)](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 | **&copy;** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
[![repo-footer](https://hosttoday.gitlab.io/assets/repo-footer.svg)](https://host.today)

1
node_modules/.yarn-integrity generated vendored Normal file
View File

@ -0,0 +1 @@
549854b8a60607db81d4c58008d59f812d744acba026266f380acd942941356a

View File

@ -1,34 +0,0 @@
{
"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"
}
}

View File

@ -1,11 +1,10 @@
{
"name": "ht-docker-node",
"version": "5.0.146",
"description": "A Docker image that integrates Node.js with shipzone.io support.",
"version": "4.3.31",
"description": "docker image with nodejs with shipzone.io support",
"main": "index.js",
"scripts": {
"test": "echo \"no npm test specified\"",
"build": "echo \"Not needed for now\""
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
@ -16,32 +15,5 @@
"bugs": {
"url": "https://github.com/HostToday/ht-docker-node/issues"
},
"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"
]
"homepage": "https://github.com/HostToday/ht-docker-node#readme"
}

9
pnpm-lock.yaml generated
View File

@ -1,9 +0,0 @@
lockfileVersion: '9.0'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
importers:
.: {}

411
public/index.html Normal file
View File

@ -0,0 +1,411 @@
<!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>&copy;</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>

View File

@ -1 +0,0 @@

278
readme.md
View File

@ -1,268 +1,40 @@
# ht-docker-node
docker image with nodejs and shipzone.io support
the ultimate docker node image
## Install
## Status
[![build status](https://gitlab.com/hosttoday/ht-docker-node/badges/master/build.svg)](https://gitlab.com/hosttoday/ht-docker-node/commits/master)
To get started with `ht-docker-node`, you need to have Docker installed on your machine. You can then pull the desired flavor of the Docker image from the relevant Docker registry.
[Docs](https://hosttoday.gitlab.io/ht-docker-node/)
Example:
```bash
docker pull registry.gitlab.com/hosttoday/ht-docker-node:latest
```
## 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.
`ht-docker-node` offers a variety of Docker image flavors to suit different needs. Below, we'll guide you through different use cases and configurations using these Docker images.
### Flavour Overview
- **:lts** - Node LTS version, equivalent to :latest
- **:stable** - Node stable version
- **:npmci** - `npmci` preinstalled
- **:npmts** - `npmci` + `npmts` preinstalled
- **:npmpage** - `npmci` + `npmts` + `npmpage` preinstalled
- **:mongo** - `npmci` + `npmts` + `mongo`
### Basic Usage
To start a container with the `lts` flavour, you can use the following command:
```bash
docker run -it --name your_container_name registry.gitlab.com/hosttoday/ht-docker-node:lts
```
### Using `npmci`
The `:npmci` flavour includes `npmci`, a utility for managing Node.js versions and npm installations. Here's an example of how you can use it:
The **:npmci flavour** has npmci in path and can install any required node version and update PATH accordingly:
```Dockerfile
FROM registry.gitlab.com/hosttoday/ht-docker-node:npmci
RUN npmci install 14.17.0
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
```
In this example, `npmci` installs Node.js version `14.17.0` and sets it as the default.
## Flavour Overview:
### Custom Dockerfile with `npmci` and your Node.js App
* **:lts** - node lts version, equals :latest
* **:stable** - node stable version
* **:npmci** - npmci preinstalled
* **:npmts** - npmci + npmts preinstalled
* **:npmpage** - npmci + npmts + npmpage preinstalled
* **:mongo** - npmci + npmts + mongo
You can create a custom Dockerfile for your Node.js application using the `:npmci` flavour:
For further information read the linked docs at the top of this README.
```Dockerfile
# Use the ht-docker-node image with npmci
FROM registry.gitlab.com/hosttoday/ht-docker-node:npmci
> MIT licensed | **&copy;** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
# Install a specific Node.js version
RUN npmci install 14.17.0
# Create app directory
WORKDIR /usr/src/app
# Copy package.json and package-lock.json
COPY package*.json ./
# Install app dependencies
RUN npm install
# Bundle app source
COPY . .
# Expose port
EXPOSE 8080
# Start the application
CMD ["node", "index.js"]
```
To build the Docker image:
```bash
docker build -t your_app_name .
```
To run the container:
```bash
docker run -p 8080:8080 --name your_container_name your_app_name
```
### Multi-Stage Builds for Production
For a leaner production image, you can use multi-stage builds. Heres an example:
```Dockerfile
# Stage 1: Build
FROM registry.gitlab.com/hosttoday/ht-docker-node:npmci as build
RUN npmci install 14.17.0
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
# Stage 2: Production
FROM registry.gitlab.com/hosttoday/ht-docker-node:lts
WORKDIR /usr/src/app
COPY --from=build /usr/src/app/dist ./
EXPOSE 8080
CMD ["node", "index.js"]
```
### Using with MongoDB (`:mongo`)
The `:mongo` flavour contains a MongoDB installation alongside Node.js. Heres how you can utilize it in your Dockerfile:
```Dockerfile
FROM registry.gitlab.com/hosttoday/ht-docker-node:mongo
# Setup mongo and node environment:
RUN npm install -g mongodb
# Working directory
WORKDIR /usr/src/app
# Copy MongoDB config
COPY mongod.conf /etc/mongod.conf
# Start MongoDB service
CMD ["mongod", "--config", "/etc/mongod.conf"] && node index.js
```
### Using `npmts` and `npmpage`
The `:npmts` and `:npmpage` flavours are useful for projects that use TypeScript or require page generation.
Heres an example on how to work with `:npmts`:
```Dockerfile
FROM registry.gitlab.com/hosttoday/ht-docker-node:npmts
# Install necessary TypeScript packages
RUN npm install -g typescript
# Working directory
WORKDIR /usr/src/app
# Copy package.json and package-lock.json
COPY package*.json ./
# Install dependencies
RUN npm install
# Copy the rest of your files
COPY . .
# Compile TypeScript
RUN npm run build
# Expose port and start the server
EXPOSE 3000
CMD ["npm", "start"]
```
### Comprehensive Use Case Example
The following example covers multiple aspects including environment variables, volume mounting, and networking.
#### Dockerfile:
```Dockerfile
FROM registry.gitlab.com/hosttoday/ht-docker-node:npmci
# Set environment variables
ENV NODE_ENV=production
ENV PORT=3000
# Install desired Node.js version
RUN npmci install 16.0.0
# Create app directory
WORKDIR /usr/src/app
# Copy package.json and package-lock.json
COPY package*.json ./
# Install app dependencies
RUN npm ci
# Bundle app source
COPY . .
# Compile TypeScript
RUN npm run build
# Expose app port
EXPOSE 3000
# Start the application
CMD ["npm", "start"]
```
#### Docker-Compose Configuration
If using Docker-Compose, create a `docker-compose.yml` file:
```yaml
version: '3.8'
services:
app:
image: your_app_name
build:
context: .
dockerfile: Dockerfile
ports:
- '3000:3000'
environment:
- NODE_ENV=production
volumes:
- .:/usr/src/app
- /usr/src/app/node_modules
networks:
- app-network
networks:
app-network:
driver: bridge
```
#### Running with Docker and Docker-Compose
To build the image:
```bash
docker-compose build
```
To run the services:
```bash
docker-compose up
```
#### Accessing the Container
```bash
docker exec -it your_container_name /bin/sh
```
### Conclusion
`ht-docker-node` offers a flexible, multifaceted solution for deploying Node.js applications in Docker containers. By leveraging its different flavours, you can efficiently manage Node.js versions, incorporate MongoDB, and handle TypeScript projects. Whether you are using simple Docker commands or elaborate Docker-Compose configurations, `ht-docker-node` caters to diverse deployment scenarios.
## 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.
[![repo-footer](https://hosttoday.gitlab.io/assets/repo-footer.svg)](https://host.today)

View File

@ -1 +1,2 @@
echo "this runs within latest container!";
#!/bin/sh
yarn -v

View File

@ -1,10 +1,9 @@
# check if npmci is available
npm init -y
npmci -v
# TODO update npmci to not require package.json
npmci node install stable
# check if we can use lts
npmci install lts
# check if npm picks it up
npmci command pnpm install -g @gitzone/tsrun
npmci command tsrun -v
# check if yarn picks it up
npmci command yarn global add npmts
npmci command npmts -v

View File

@ -1,5 +1,3 @@
# npm
npm -v
node -v
pnpm install -g @gitzone/tsrun
tsrun -v
# test yarn
yarn global add npmts
npmts -v

View File

@ -1,14 +0,0 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"useDefineForClassFields": false,
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"esModuleInterop": true,
"verbatimModuleSyntax": true
},
"exclude": [
"dist_*/**/*.d.ts"
]
}