From 90affc94205501d60328b40055e1df1990b94fe5 Mon Sep 17 00:00:00 2001 From: Peter Butkovic Date: Thu, 5 Nov 2020 12:01:42 +0100 Subject: [PATCH 1/3] Dockerfile introduced --- Dockerfile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..b1275dcf --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM node:lts-alpine + +# Create app directory +WORKDIR /usr/src/app + +# Install app dependencies +# A wildcard is used to ensure both package.json AND package-lock.json are copied +# where available (npm@5+) +COPY package*.json ./ + +RUN npm install + +# Bundle app source +COPY . . + +CMD [ "node", "widdershins" ] From 00c000de903bdbb5501693f4f7285f7d76ea0ec3 Mon Sep 17 00:00:00 2001 From: Peter Butkovic Date: Thu, 5 Nov 2020 12:50:27 +0100 Subject: [PATCH 2/3] initial docker docs introduced --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 0b7a6545..20bdbfc9 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,8 @@ OpenAPI / Swagger / AsyncAPI / Semoasa definition to [Slate](https://github.com/ * Clone the git repository, and `npm i` to install dependencies, or * `npm install -g widdershins` to install globally +or run via docker image (TODO dockerhub image link). + ### Getting started Widdershins is generally used as a stage in an API documentation pipeline. The pipeline begins with an API definition in OpenAPI 3.x, OpenAPI 2.0 (fka Swagger), API Blueprint, AsyncAPI or Semoasa format. Widdershins converts this description into markdown suitable for use by a **renderer**, such as [Slate](https://github.com/lord/slate), [Shins](https://github.com/mermade/shins) or html suitable for use with [ReSpec](https://github.com/w3c/respec). @@ -46,6 +48,11 @@ More in-depth documentation is [available here](https://mermade.github.io/widder node widdershins --search false --language_tabs 'ruby:Ruby' 'python:Python' --summary defs/petstore3.json -o petstore3.md ``` +or to run in docker: +``` +docker run -it --rm -v ${PWD}/petstore3.json:/usr/src/app/petstore3.json:ro -v ${PWD}/md/:/usr/src/app/md/ (TODO dockerhub org)/widdershins:latest /bin/sh -c "node widdershins /usr/src/app/petstore3.json --search false --language_tabs 'ruby:Ruby' 'python:Python' --summary -o /usr/src/app/md/petstore3.html.md" +``` + ### Options | CLI parameter name | JavaScript parameter name | Type | Default value | Description | From 54599cb7d8acedc2fa3f6d6683090c94c63e207d Mon Sep 17 00:00:00 2001 From: Peter Butkovic Date: Mon, 23 Nov 2020 01:18:11 +0100 Subject: [PATCH 3/3] .dockerignore introduced --- .dockerignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..27f0e1e6 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +node_modules +.*