-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathDockerfile
51 lines (34 loc) · 1.48 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
FROM openjdk:11-jre-slim-stretch as server
ARG SPARK_VERSION=3.3.2
ARG HADOOP_VERSION=3
WORKDIR /home/app/
COPY server/ ./server/
WORKDIR /home/app/server/
RUN ./gradlew build -x test -PSPARK_VERSION=${SPARK_VERSION}
FROM node:lts-alpine3.14 as frontend
ARG SPARK_VERSION=3.3.2
ARG HADOOP_VERSION=3
ENV REACT_APP_API_BASE_URL='/lighter'
WORKDIR /home/app/
COPY frontend/ ./frontend/
RUN wget "https://downloads.apache.org/spark/spark-${SPARK_VERSION}/spark-${SPARK_VERSION}-bin-hadoop${HADOOP_VERSION}.tgz" -O - | tar -xz
WORKDIR /home/app/frontend/
RUN yarn install && yarn build
FROM openjdk:11-jre-slim-stretch
ARG SPARK_VERSION=3.3.2
ARG HADOOP_VERSION=3
ENV FRONTEND_PATH=/home/app/frontend/
ENV SPARK_HOME=/home/app/spark/
# Add symlinks so that after deployment of CM configs symlinks are still in tact
RUN ln -s /etc/hadoop/conf.cloudera.yarn /etc/alternatives/hadoop-conf \
&& ln -s /etc/hive/conf.cloudera.hive /etc/alternatives/hive-conf
WORKDIR /home/app/
COPY --from=server /home/app/server/build/docker/main/layers/libs /home/app/libs
COPY --from=server /home/app/server/build/docker/main/layers/resources /home/app/resources
COPY --from=server /home/app/server/build/docker/main/layers/application.jar /home/app/application.jar
COPY --from=frontend /home/app/frontend/build/ ./frontend/
COPY --from=frontend /home/app/spark-${SPARK_VERSION}-bin-hadoop${HADOOP_VERSION}/ ./spark/
COPY k8s/ ./k8s/
EXPOSE 8080
EXPOSE 25333
ENTRYPOINT ["java", "-jar", "/home/app/application.jar"]