-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
23 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,20 @@ | ||
FROM node:alpine | ||
|
||
WORKDIR /build | ||
|
||
# Copy files required for npm install only | ||
COPY package.json package-lock.json /build/ | ||
COPY packages/cli/package.json /build/packages/cli/ | ||
COPY packages/core/package.json /build/packages/core/ | ||
COPY packages/cli/bin/ /build/packages/cli/bin/ | ||
|
||
RUN npm ci --no-optional --ignore-scripts | ||
|
||
# Copy rest of the files | ||
COPY . /build/ | ||
RUN npm run prepare | ||
|
||
# Install redocly-cli globally, similar to npm install --global @redocly/cli | ||
# but the local package is used here | ||
RUN apk update && apk add jq && \ | ||
apk add git && \ | ||
COPY . . | ||
RUN apk add --no-cache jq git && \ | ||
npm ci --no-optional --ignore-scripts && \ | ||
npm run prepare && \ | ||
npm run pack:prepare && \ | ||
npm install --global redocly-cli.tgz | ||
|
||
# npm pack in the previous RUN command does not include these assets | ||
RUN cp packages/cli/src/commands/preview-docs/preview-server/default.hbs /usr/local/lib/node_modules/@redocly/cli/lib/commands/preview-docs/preview-server/default.hbs && \ | ||
cp packages/cli/src/commands/preview-docs/preview-server/hot.js /usr/local/lib/node_modules/@redocly/cli/lib/commands/preview-docs/preview-server/hot.js && \ | ||
cp packages/cli/src/commands/build-docs/template.hbs /usr/local/lib/node_modules/@redocly/cli/lib/commands/build-docs/template.hbs | ||
|
||
# Clean up to reduce image size | ||
RUN npm cache clean --force && rm -rf /build | ||
npm install --global redocly-cli.tgz && \ | ||
cp packages/cli/src/commands/preview-docs/preview-server/default.hbs \ | ||
packages/cli/src/commands/preview-docs/preview-server/hot.js \ | ||
/usr/local/lib/node_modules/@redocly/cli/lib/commands/preview-docs/preview-server/ && \ | ||
cp packages/cli/src/commands/build-docs/template.hbs \ | ||
/usr/local/lib/node_modules/@redocly/cli/lib/commands/build-docs/ && \ | ||
# Clean up to reduce image size | ||
npm cache clean --force && rm -rf /build | ||
|
||
WORKDIR /spec | ||
|
||
ENTRYPOINT [ "redocly" ] | ||
|
||
ENTRYPOINT ["redocly"] | ||
ENV REDOCLY_ENVIRONMENT=docker |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,9 +74,5 @@ | |
}, | ||
"files": [ | ||
"lib" | ||
], | ||
"publishConfig": { | ||
"access": "public", | ||
"registry": "https://registry.npmjs.org/" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters