-
-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(repo): use distributed spectral-alpine binary
- Loading branch information
Showing
1 changed file
with
6 additions
and
31 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,37 +1,12 @@ | ||
FROM node:12 as compiler | ||
FROM node:16-alpine | ||
|
||
WORKDIR /usr/src/spectral | ||
|
||
COPY package.json tsconfig.rollup.json rollup.config.js yarn.lock tsconfig.build.json tsconfig.json /usr/src/spectral/ | ||
COPY scripts/ /usr/src/spectral/scripts | ||
COPY src/ /usr/src/spectral/src/ | ||
|
||
RUN yarn && yarn build | ||
|
||
############################################################### | ||
FROM node:12 as dependencies | ||
|
||
WORKDIR /usr/src/spectral/ | ||
|
||
COPY package.json /usr/src/spectral/ | ||
|
||
ENV NODE_ENV production | ||
RUN yarn --production | ||
|
||
RUN curl -sfL https://install.goreleaser.com/github.com/tj/node-prune.sh | bash | ||
RUN ./bin/node-prune | ||
|
||
############################################################### | ||
FROM node:12-alpine | ||
|
||
COPY scripts/install.sh /usr/src/spectral/ | ||
RUN ls -l | ||
RUN apk --no-cache add curl | ||
RUN ./install.sh | ||
RUN rm ./install.sh | ||
ENV NODE_ENV production | ||
|
||
COPY package.json /usr/src/spectral/ | ||
|
||
COPY --from=compiler /usr/src/spectral/dist /usr/src/spectral/dist | ||
COPY --from=dependencies /usr/src/spectral/node_modules/ /usr/src/spectral/node_modules/ | ||
|
||
RUN ln -s /usr/src/spectral/dist/cli/index.js /usr/bin/spectral \ | ||
&& chmod +x /usr/bin/spectral | ||
|
||
ENTRYPOINT [ "spectral" ] |