Skip to content

Commit a885b72

Browse files
committed
build(repo): use distributed spectral-alpine binary
1 parent d3785a8 commit a885b72

File tree

1 file changed

+6
-31
lines changed

1 file changed

+6
-31
lines changed

Dockerfile

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,12 @@
1-
FROM node:12 as compiler
1+
FROM node:16-alpine
22

33
WORKDIR /usr/src/spectral
44

5-
COPY package.json tsconfig.rollup.json rollup.config.js yarn.lock tsconfig.build.json tsconfig.json /usr/src/spectral/
6-
COPY scripts/ /usr/src/spectral/scripts
7-
COPY src/ /usr/src/spectral/src/
8-
9-
RUN yarn && yarn build
10-
11-
###############################################################
12-
FROM node:12 as dependencies
13-
14-
WORKDIR /usr/src/spectral/
15-
16-
COPY package.json /usr/src/spectral/
17-
18-
ENV NODE_ENV production
19-
RUN yarn --production
20-
21-
RUN curl -sfL https://install.goreleaser.com/github.com/tj/node-prune.sh | bash
22-
RUN ./bin/node-prune
23-
24-
###############################################################
25-
FROM node:12-alpine
26-
5+
COPY scripts/install.sh /usr/src/spectral/
6+
RUN ls -l
7+
RUN apk --no-cache add curl
8+
RUN ./install.sh
9+
RUN rm ./install.sh
2710
ENV NODE_ENV production
2811

29-
COPY package.json /usr/src/spectral/
30-
31-
COPY --from=compiler /usr/src/spectral/dist /usr/src/spectral/dist
32-
COPY --from=dependencies /usr/src/spectral/node_modules/ /usr/src/spectral/node_modules/
33-
34-
RUN ln -s /usr/src/spectral/dist/cli/index.js /usr/bin/spectral \
35-
&& chmod +x /usr/bin/spectral
36-
3712
ENTRYPOINT [ "spectral" ]

0 commit comments

Comments
 (0)