mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-25 18:13:44 +03:00
Dockerfile to package the 'redoc-cli' tool as a docker image
This commit is contained in:
parent
17386036c5
commit
fec72ac0ea
|
@ -1,25 +1,30 @@
|
|||
# To build:
|
||||
# - Must be in the project root directory
|
||||
# - docker build -f cli/Dockerfile .
|
||||
# Package the 'redoc-cli' as a docker image.
|
||||
#
|
||||
# To run
|
||||
# - docker run --rm -i -t <image> --help
|
||||
|
||||
# To build:
|
||||
# $ cd <Redoc project directory>
|
||||
# $ docker build -t redoc-cli -f cli/Dockerfile .
|
||||
#
|
||||
# To run:
|
||||
# To display the command line options:
|
||||
# $ docker run --rm -it redoc-cli redoc-cli --help
|
||||
# .. will display the comand line help
|
||||
#
|
||||
# To the `swagger.yml` file in the current directory, and output 'redoc-static.html'
|
||||
# $ docker run --rm -it -v $PWD:/data redoc-cli redoc-cli bundle swagger.yml
|
||||
|
||||
FROM node:alpine
|
||||
|
||||
# Needs python, alpine-sdk to build node packages
|
||||
RUN apk update && apk add --no-cache git python alpine-sdk nodejs
|
||||
|
||||
# generate bundle
|
||||
WORKDIR /build
|
||||
COPY . /build
|
||||
#RUN cd cli && npm run compile:cli
|
||||
RUN yarn install --frozen-lockfile --ignore-optional --ignore-scripts
|
||||
RUN npm run bundle && npm run compile:cli
|
||||
|
||||
RUN npm install typescript
|
||||
RUN npm install iltorb
|
||||
RUN npm install -g redoc-cli
|
||||
RUN yarn install --frozen-lockfile --ignore-optional --ignore-scripts && \
|
||||
npm run bundle && npm run compile:cli && \
|
||||
npm install typescript && \
|
||||
npm install iltorb && \
|
||||
npm install -g redoc-cli
|
||||
|
||||
ENTRYPOINT ["redoc-cli"]
|
||||
WORKDIR /data
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user