diff --git a/Dockerfile b/Dockerfile index f2df39480..be98a185a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,15 @@ +FROM node:14-alpine AS markdownlint + +RUN npm install -g markdownlint-cli + +USER node + +ENTRYPOINT ["markdownlint"] + +CMD ["/data"] + +### + FROM node:14-alpine AS assets ARG NODE_ENV="production" diff --git a/docker-compose.override.yaml.example b/docker-compose.override.yaml.example index 58c56311b..7f2074815 100644 --- a/docker-compose.override.yaml.example +++ b/docker-compose.override.yaml.example @@ -23,3 +23,10 @@ services: js: <<: *default-assets command: "./run yarn:build:js" + + markdownlint: + build: + context: "." + target: "markdownlint" + volumes: + - "./source:/data/source" diff --git a/markdownlint.Dockerfile b/markdownlint.Dockerfile deleted file mode 100644 index 1b2295d20..000000000 --- a/markdownlint.Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM node:14-alpine -ENTRYPOINT ["markdownlint"] -CMD ["/data"] -WORKDIR /root -RUN npm install -g markdownlint-cli diff --git a/run b/run index 7b64dc7ad..79037c083 100755 --- a/run +++ b/run @@ -46,17 +46,8 @@ function help { printf "\nExtended help:\n Each task has comments for general usage\n" } -function markdownlint:build { - docker image build . \ - -f markdownlint.Dockerfile \ - -t markdownlint -} - -function markdownlint:run { - docker container run --rm \ - -v $(pwd)/.markdownlint.yaml:/root/.markdownlint.yaml \ - -v $(pwd)/source:/data \ - markdownlint +function lint:markdown { + docker-compose run --rm markdownlint "${@}" } function run-production {