forked from swoogles/zio-ecosystem
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (33 loc) · 1.2 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
FROM python:3.7
ENV JAVA_HOME=/opt/java/openjdk
COPY --from=eclipse-temurin:11 $JAVA_HOME $JAVA_HOME
ENV PATH="${JAVA_HOME}/bin:${PATH}"
# Setup adapted from https://github.com/hseeberger/scala-sbt/blob/master/debian/Dockerfile
RUN \
apt-get update -q && \
apt-get upgrade -qq && \
apt-get install -y git gcc graphviz-dev && \
rm -rf /var/lib/apt/lists/* && \
pip install --upgrade pip
# Install SBT
RUN \
curl -L "https://github.com/sbt/sbt/releases/download/v1.5.7/sbt-1.5.7.tgz" | tar zxf - -C /usr/share && \
cd /usr/share/sbt/bin && \
rm sbt.bat sbtn-x86_64-apple-darwin sbtn-x86_64-pc-linux sbtn-x86_64-pc-win32.exe && \
ln -s /usr/share/sbt/bin/sbt /usr/local/bin/sbt
# Copy files into the Docker image
WORKDIR /project-root
COPY project ./project
COPY python-code ./python-code
COPY src ./src
COPY build.sbt ./
# Compile the Scala code
RUN sbt compile;
# Set up the Python code
RUN \
cd python-code && \
pip install -U -r requirements.txt && \
cd ..
# This runs the Scala program in "dot" mode. The output is piped to the Python
# code which renders it as a spiffy SVG graphic to STDOUT.
CMD /bin/sh -c 'sbt --error "run dot" | python python-code/zio_ecosystem/create_svg_graphic.py'