-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
54 lines (38 loc) · 1.71 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Architecture, e.g. amd64 or arm64v8
ARG ARCHPREFIX=arm64v8
# Ubuntu release
ARG RELEASE=jammy
# build with docker buildx build --platform linux/arm64 .
# Note: this needs host system (binfmt) support
# https://docs.docker.com/build/building/multi-platform/#qemu
FROM ${ARCHPREFIX}/ubuntu:${RELEASE}
ENV DEBIAN_FRONTEND=noninteractive
ENV LANG C.UTF-8
# Install Nodesource repo key
RUN apt-get update && \
apt-get install -y ca-certificates curl gnupg && \
mkdir -p /etc/apt/keyrings && \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
# Install Node.js
ARG NODE_MAJOR=20
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_MAJOR}.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
apt-get update && \
apt-get install -y nodejs
# Install node-canvas build dependencies
# https://github.com/Automattic/node-canvas/wiki/Installation:-Ubuntu-and-other-Debian-based-systems
RUN apt-get install -y build-essential libcairo2-dev libpango1.0-dev libjpeg-dev #not used: #libgif-dev librsvg2-dev
# Install yarn for Cornerstone.js
RUN corepack enable && \
corepack prepare [email protected] --activate
# Build the patched Cornerstone.js libraries and install runtime dependencies
WORKDIR /dicom-render
COPY install.sh package*.json .
RUN ./install.sh && npm install
# Build the dicom.js module that is used by dicom-render.js to render DICOM images
COPY lib/* ./lib/
COPY rollup.config.mjs .
# https://docs.docker.com/engine/reference/builder/#copy---parents will solve this but until then...
RUN npm run build:rollup
# Copy runtime files
COPY dicom-render.js .
ENTRYPOINT [ "/dicom-render/dicom-render.js" ]