Skip to content

Commit

Permalink
Allow running spectral from anywhere in Docker (#1022)
Browse files Browse the repository at this point in the history
This removes the requirement that forces you to leave the workdir as
`/usr/src/spectral` when you're running the Docker container by adding a
symlink to spectral in `/usr/bin`.

Co-authored-by: Phil Sturgeon <phil@stoplight.io>
Co-authored-by: Jakub Rożek <jakub@stoplight.io>
  • Loading branch information
3 people authored Apr 17, 2020
1 parent f8b683b commit d5da530
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ RUN ./bin/node-prune
###############################################################
FROM node:12-alpine

WORKDIR /usr/src/spectral
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/

WORKDIR /usr/src/spectral/
RUN ln -s /usr/src/spectral/dist/cli/index.js /usr/bin/spectral \
&& chmod +x /usr/bin/spectral

ENTRYPOINT [ "node", "dist/cli/index.js" ]
ENTRYPOINT [ "spectral" ]

0 comments on commit d5da530

Please sign in to comment.