forked from smart-on-fhir/cumulus-etl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
47 lines (37 loc) · 1.49 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
# syntax=docker/dockerfile:1
FROM alpine/git as ms-tool-src
RUN git clone https://github.com/microsoft/Tools-for-Health-Data-Anonymization.git /app
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS ms-tool
COPY --from=ms-tool-src /app /app
# This will force builds to fail if the environment piping breaks for some reason
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN arch=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/x64/) && \
dotnet publish \
--runtime=linux-${arch} \
--self-contained=true \
--configuration=Release \
-p:InvariantGlobalization=true \
-p:PublishSingleFile=true \
--output=/bin \
/app/FHIR/src/Microsoft.Health.Fhir.Anonymizer.R4.CommandLineTool
FROM python:3.10 AS cumulus-etl-test
COPY --from=eclipse-temurin:17-jre /opt/java/openjdk /opt/java/openjdk
COPY --from=ms-tool /bin/Microsoft.Health.Fhir.Anonymizer.R4.CommandLineTool /bin
COPY . /app
RUN --mount=type=cache,target=/root/.cache \
pip3 install /app/[tests]
RUN rm -r /app
ENV JAVA_HOME /opt/java/openjdk
ENTRYPOINT ["cumulus-etl"]
FROM python:3.10 AS cumulus-etl
COPY --from=eclipse-temurin:17-jre /opt/java/openjdk /opt/java/openjdk
COPY --from=ms-tool /bin/Microsoft.Health.Fhir.Anonymizer.R4.CommandLineTool /bin
# Ship pre-downloaded nltk files, used by philter
RUN pip3 install nltk
RUN python3 -m nltk.downloader -d /usr/local/share/nltk_data averaged_perceptron_tagger
COPY . /app
RUN --mount=type=cache,target=/root/.cache \
pip3 install /app
RUN rm -r /app
ENV JAVA_HOME /opt/java/openjdk
ENTRYPOINT ["cumulus-etl"]