This is an automated email from the ASF dual-hosted git repository. rabbah pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/openwhisk-runtime-nodejs.git
commit c20992538ef41964ed95124a8d1cb8c1082fe589 Author: Rodric Rabbah <[email protected]> AuthorDate: Wed May 13 12:18:55 2020 -0400 Cleanup and normalize dockerfiles. --- core/nodejs10Action/.dockerignore | 15 ++++++++++----- core/nodejs10Action/Dockerfile | 23 ++++++++++++++++++----- core/nodejs12Action/.dockerignore | 15 ++++++++++----- core/nodejs12Action/Dockerfile | 19 +++++++++++++++---- core/nodejs14Action/.dockerignore | 15 ++++++++++----- core/nodejs14Action/Dockerfile | 19 +++++++++++++++---- core/nodejs8Action/.dockerignore | 15 ++++++++++----- core/nodejs8Action/Dockerfile | 20 ++++++++++++++++---- core/nodejsActionBase/.dockerignore | 15 +++++++++++++++ core/nodejsActionBase/Dockerfile | 23 +++++++++++++++++------ core/nodejsActionBase/build.gradle | 2 +- core/nodejsActionBase/package.json | 22 ++++++++++++++-------- 12 files changed, 151 insertions(+), 52 deletions(-) diff --git a/core/nodejs10Action/.dockerignore b/core/nodejs10Action/.dockerignore index 3081e3e..a1d03cb 100644 --- a/core/nodejs10Action/.dockerignore +++ b/core/nodejs10Action/.dockerignore @@ -1,8 +1,13 @@ -node_modules -package-lock.json -Dockerfile -build.gradle +*.*~ +*.yaml +*.tmpl +*.gradle +.dockerignore .project .settings build.xml -logs \ No newline at end of file +Dockerfile +logs +node_modules +package-lock.json +test.js diff --git a/core/nodejs10Action/Dockerfile b/core/nodejs10Action/Dockerfile index d880d8b..17f2707 100644 --- a/core/nodejs10Action/Dockerfile +++ b/core/nodejs10Action/Dockerfile @@ -16,17 +16,30 @@ # FROM node:10.20.1-stretch + +# Initial update and some basics. +# RUN apt-get update && apt-get install -y \ imagemagick \ graphicsmagick \ unzip \ && rm -rf /var/lib/apt/lists/* + +# Add sources and copy the package.json to root container, +# so npm packages from user functions take precendence. +# WORKDIR /nodejsAction -COPY . . -# COPY the package.json to root container, so we can install npm packages a level up from user's packages, so user's packages take precedence -COPY ./package.json / -RUN cd / && npm install --no-package-lock \ +ADD . /nodejsAction/ +COPY package.json / + +# Customize runtime with additional packages. +# Install package globally so user packages can override. +# +RUN cd / && npm install --no-package-lock --production \ && npm cache clean --force + EXPOSE 8080 -# The flag --experimental-worker enables worker threads, see https://nodejs.org/docs/latest-v10.x/api/worker_threads.html + +# The flag --experimental-worker enables worker threads, +# see https://nodejs.org/docs/latest-v10.x/api/worker_threads.html CMD node --experimental-worker --expose-gc app.js diff --git a/core/nodejs12Action/.dockerignore b/core/nodejs12Action/.dockerignore index 3081e3e..a1d03cb 100644 --- a/core/nodejs12Action/.dockerignore +++ b/core/nodejs12Action/.dockerignore @@ -1,8 +1,13 @@ -node_modules -package-lock.json -Dockerfile -build.gradle +*.*~ +*.yaml +*.tmpl +*.gradle +.dockerignore .project .settings build.xml -logs \ No newline at end of file +Dockerfile +logs +node_modules +package-lock.json +test.js diff --git a/core/nodejs12Action/Dockerfile b/core/nodejs12Action/Dockerfile index 7344a0e..8b3d8ef 100644 --- a/core/nodejs12Action/Dockerfile +++ b/core/nodejs12Action/Dockerfile @@ -16,17 +16,28 @@ # FROM node:12.16.2-stretch + +# Initial update and some basics. +# RUN apt-get update && apt-get install -y \ imagemagick \ graphicsmagick \ unzip \ && rm -rf /var/lib/apt/lists/* + +# Add sources and copy the package.json to root container, +# so npm packages from user functions take precendence. +# WORKDIR /nodejsAction -COPY . . -# COPY the package.json to root container, so we can install npm packages a level up from user's packages, so user's packages take precedence -COPY ./package.json / -RUN cd / && npm install --no-package-lock \ +ADD . /nodejsAction/ +COPY package.json / + +# Customize runtime with additional packages. +# Install package globally so user packages can override. +# +RUN cd / && npm install --no-package-lock --production \ && npm cache clean --force + EXPOSE 8080 CMD node --expose-gc app.js diff --git a/core/nodejs14Action/.dockerignore b/core/nodejs14Action/.dockerignore index 3081e3e..a1d03cb 100644 --- a/core/nodejs14Action/.dockerignore +++ b/core/nodejs14Action/.dockerignore @@ -1,8 +1,13 @@ -node_modules -package-lock.json -Dockerfile -build.gradle +*.*~ +*.yaml +*.tmpl +*.gradle +.dockerignore .project .settings build.xml -logs \ No newline at end of file +Dockerfile +logs +node_modules +package-lock.json +test.js diff --git a/core/nodejs14Action/Dockerfile b/core/nodejs14Action/Dockerfile index f0262f0..c94a94a 100644 --- a/core/nodejs14Action/Dockerfile +++ b/core/nodejs14Action/Dockerfile @@ -16,17 +16,28 @@ # FROM node:14.2.0-stretch + +# Initial update and some basics. +# RUN apt-get update && apt-get install -y \ imagemagick \ graphicsmagick \ unzip \ && rm -rf /var/lib/apt/lists/* + +# Add sources and copy the package.json to root container, +# so npm packages from user functions take precendence. +# WORKDIR /nodejsAction -COPY . . -# COPY the package.json to root container, so we can install npm packages a level up from user's packages, so user's packages take precedence -COPY ./package.json / -RUN cd / && npm install --no-package-lock \ +ADD . /nodejsAction/ +COPY package.json / + +# Customize runtime with additional packages. +# Install package globally so user packages can override. +# +RUN cd / && npm install --no-package-lock --production \ && npm cache clean --force + EXPOSE 8080 CMD node --expose-gc app.js diff --git a/core/nodejs8Action/.dockerignore b/core/nodejs8Action/.dockerignore index 3081e3e..a1d03cb 100644 --- a/core/nodejs8Action/.dockerignore +++ b/core/nodejs8Action/.dockerignore @@ -1,8 +1,13 @@ -node_modules -package-lock.json -Dockerfile -build.gradle +*.*~ +*.yaml +*.tmpl +*.gradle +.dockerignore .project .settings build.xml -logs \ No newline at end of file +Dockerfile +logs +node_modules +package-lock.json +test.js diff --git a/core/nodejs8Action/Dockerfile b/core/nodejs8Action/Dockerfile index 9f0c465..fce88f3 100644 --- a/core/nodejs8Action/Dockerfile +++ b/core/nodejs8Action/Dockerfile @@ -16,16 +16,28 @@ # FROM node:8.17.0 + +# Initial update and some basics. +# RUN apt-get update && apt-get install -y \ imagemagick \ graphicsmagick \ unzip \ && rm -rf /var/lib/apt/lists/* + +# Add sources and copy the package.json to root container, +# so npm packages from user functions take precendence. +# WORKDIR /nodejsAction -COPY . . -# COPY the package.json to root container, so we can install npm packages a level up from user's packages, so user's packages take precedence -COPY ./package.json / -RUN cd / && npm install --no-package-lock \ +ADD . /nodejsAction/ +COPY package.json / + +# Customize runtime with additional packages. +# Install package globally so user packages can override. +# +RUN cd / && npm install --no-package-lock --production \ && npm cache clean --force + EXPOSE 8080 + CMD node --expose-gc app.js diff --git a/core/nodejsActionBase/.dockerignore b/core/nodejsActionBase/.dockerignore new file mode 100644 index 0000000..ee1b7bb --- /dev/null +++ b/core/nodejsActionBase/.dockerignore @@ -0,0 +1,15 @@ +*.*~ +.dockerignore +node_modules +package-lock.json +.project +.settings +build.xml +logs +Dockerfile +test.js +*.json +*.yaml +*.tmpl +*.gradle +!package.json diff --git a/core/nodejsActionBase/Dockerfile b/core/nodejsActionBase/Dockerfile index 117c168..cb6bfbb 100644 --- a/core/nodejsActionBase/Dockerfile +++ b/core/nodejsActionBase/Dockerfile @@ -15,17 +15,28 @@ # limitations under the License. # -FROM buildpack-deps:trusty-curl - -ENV DEBIAN_FRONTEND noninteractive +FROM node:stretch # Initial update and some basics. +# RUN apt-get update && apt-get install -y \ imagemagick \ graphicsmagick \ unzip \ && rm -rf /var/lib/apt/lists/* -ADD . /nodejsAction -# COPY the package.json to root container, so we can install npm packages a level up from user's packages, so user's packages take precedence -COPY ./package.json / +# Add sources and copy the package.json to root container, +# so npm packages from user functions take precendence. +# +ADD . /nodejsAction/ +COPY package.json / + +# Customize runtime with additional packages. +# +RUN cd / && npm install --no-package-lock --production \ + && npm cache clean --force + +EXPOSE 8080 + +WORKDIR /nodejsAction +CMD node --expose-gc app.js diff --git a/core/nodejsActionBase/build.gradle b/core/nodejsActionBase/build.gradle index 3a9873e..8b90e7d 100644 --- a/core/nodejsActionBase/build.gradle +++ b/core/nodejsActionBase/build.gradle @@ -23,5 +23,5 @@ eclipse { } } -ext.dockerImageName = 'nodejsactionbase' +ext.dockerImageName = 'action-nodejs-base' apply from: '../../gradle/docker.gradle' diff --git a/core/nodejsActionBase/package.json b/core/nodejsActionBase/package.json index 848543e..b85170a 100644 --- a/core/nodejsActionBase/package.json +++ b/core/nodejsActionBase/package.json @@ -1,20 +1,26 @@ { - "name": "nodejsAction", - "version": "0.0.1", + "name": "action-nodejs-base", + "version": "1.0.0", + "description": "Apache OpenWhisk NodeJS Runtime", + "repository": { + "type": "git", + "url": "[email protected]:apache/openwhisk-runtime-nodejs.git" + }, + "license": "Apache-2.0", "devDependencies": { + "btoa": "1.1.2", "eslint": "^5.16.0", "eslint-config-standard": "^12.0.0", "eslint-plugin-import": "^2.17.2", "eslint-plugin-node": "^8.0.1", "eslint-plugin-promise": "^4.1.1", - "eslint-plugin-standard": "^4.0.0" + "eslint-plugin-standard": "^4.0.0", + "request": "2.79.0" }, "dependencies": { - "body-parser": "1.15.2", - "btoa": "1.1.2", - "express": "4.14.0", - "log4js": "0.6.38", - "request": "2.79.0", + "openwhisk": "3.21.2", + "body-parser": "1.18.3", + "express": "4.16.4", "serialize-error": "3.0.0", "redis": "2.8.0", "uuid": "3.3.0"
