-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathDockerfile
56 lines (42 loc) · 1.55 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
55
56
FROM openjdk:11
#FROM ubuntu:latest
WORKDIR /usr/src/lambdanet
# instsll typescript dependencies
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get install -y nodejs
RUN npm install -g [email protected] cloc
RUN npm i fs source-map-support [email protected] [email protected]
RUN npm i @types/node @types/source-map-support @types/yargs
# install scala dependencies
RUN apt-get install -y zip unzip
RUN echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | sudo tee /etc/apt/sources.list.d/sbt.list
RUN echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | sudo tee /etc/apt/sources.list.d/sbt_old.list
RUN curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo apt-key add
RUN sudo apt-get update
RUN sudo apt-get install sbt
# Prepare sbt (warm cache)
WORKDIR /usr/src/sbt-temp
# Env variables
ARG SCALA_VERSION
ENV SCALA_VERSION ${SCALA_VERSION:-2.12.10}
ARG SBT_VERSION
ENV SBT_VERSION ${SBT_VERSION:-1.3.13}
RUN \
sbt sbtVersion && \
mkdir -p project && \
echo "scalaVersion := \"${SCALA_VERSION}\"" > build.sbt && \
echo "sbt.version=${SBT_VERSION}" > project/build.properties && \
echo "case object Temp" > Temp.scala && \
sbt compile && \
rm -r project && rm build.sbt && rm Temp.scala && rm -r target
WORKDIR /usr/src/lambdanet
# Copy all files
COPY . .
# Compile TS scripts
WORKDIR scripts/ts
RUN tsc || echo "tsc errors encountered."
WORKDIR /usr/src/lambdanet
# Compile Scala files
RUN sbt "runMain lambdanet.JavaAPI"
ENV OMP_NUM_THREADS=1
CMD ["/bin/sh"]