Skip to content

Commit

Permalink
Containerfile to create image from current source
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Blümel <[email protected]>
  • Loading branch information
Blaimi committed May 25, 2023
1 parent 6d1146e commit 0c08691
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/.*
/node_modules
/appscan-config.xml
/*.md
/LICENSE
19 changes: 19 additions & 0 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM node:current-alpine3.17 AS builder

COPY package.json package-lock.json ./
RUN npm ci

COPY . ./
RUN cd packages/validator && npm pack && mv ibm-openapi-validator-*.tgz /tmp/ibm-openapi-validator-latest.tgz

FROM node:current-alpine3.17

RUN apk add --no-cache git

COPY --from=builder /tmp/ibm-openapi-validator-latest.tgz /tmp
# not possible to install from github directly https://github.com/npm/npm/issues/2974
RUN npm install -g /tmp/ibm-openapi-validator-latest.tgz \
&& npm cache clean --force

WORKDIR /code
ENTRYPOINT ["lint-openapi", "--config", "/config.json", "--codeclimate"]

0 comments on commit 0c08691

Please sign in to comment.