build(docker): move Markdownlint

Move Markdownlint into the main Dockerfile and a service to the Docker
Compose override file.
This commit is contained in:
Oliver Davies 2022-01-12 22:14:33 +00:00
parent 9f510e4e23
commit b0990f7edb
4 changed files with 21 additions and 16 deletions

View file

@ -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"

View file

@ -23,3 +23,10 @@ services:
js:
<<: *default-assets
command: "./run yarn:build:js"
markdownlint:
build:
context: "."
target: "markdownlint"
volumes:
- "./source:/data/source"

View file

@ -1,5 +0,0 @@
FROM node:14-alpine
ENTRYPOINT ["markdownlint"]
CMD ["/data"]
WORKDIR /root
RUN npm install -g markdownlint-cli

13
run
View file

@ -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 {