forked from bids-standard/bids-validator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
30 lines (24 loc) · 799 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
ARG BASE_IMAGE=denoland/deno:2.0.1
FROM ${BASE_IMAGE} AS build
WORKDIR /src
RUN apt-get update && \
apt-get install -y git jq && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
ADD . .
RUN export VERSION=`git -C . -c safe.directory=* describe --tags --always` && \
jq -r ".version|=\"$VERSION\"" bids-validator/deno.json > ._deno.json
WORKDIR /src/bids-validator
RUN deno cache ./bids-validator-deno
RUN ./build.ts
FROM ${BASE_IMAGE} AS base
WORKDIR /src
COPY . .
COPY --from=build /src/._deno.json /src/bids-validator/deno.json
WORKDIR /src/bids-validator
RUN deno cache ./bids-validator-deno
ENTRYPOINT ["./bids-validator-deno"]
FROM ${BASE_IMAGE} AS min
WORKDIR /src
COPY --from=build /src/bids-validator/dist/validator/* .
ENTRYPOINT ["deno", "-A", "./bids-validator.js"]