Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile introduced #391

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.*
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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" ]
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand All @@ -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 |
Expand Down