2020-04-04 20:21:29 +05:30
|
|
|
FROM openjdk:8 as builder
|
2019-09-02 23:21:01 -07:00
|
|
|
|
2021-02-10 16:10:08 -08:00
|
|
|
ARG ENABLE_REACT
|
|
|
|
ARG PORT
|
|
|
|
|
2019-09-03 00:46:12 -07:00
|
|
|
RUN apt-get update && apt-get install -y wget \
|
|
|
|
&& wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
|
2020-09-22 22:02:37 +03:00
|
|
|
&& apt-get -y install ./google-chrome-stable_current_amd64.deb
|
2019-09-03 00:46:12 -07:00
|
|
|
|
|
|
|
ENV CI=true
|
|
|
|
|
2019-09-02 23:21:01 -07:00
|
|
|
COPY . datahub-src
|
2021-02-10 16:10:08 -08:00
|
|
|
RUN cd datahub-src && ./gradlew :datahub-frontend:dist -PenableReact=${ENABLE_REACT} \
|
2019-09-02 23:21:01 -07:00
|
|
|
&& cp datahub-frontend/build/distributions/datahub-frontend.zip ../datahub-frontend.zip \
|
|
|
|
&& cd .. && rm -rf datahub-src && unzip datahub-frontend.zip
|
|
|
|
|
2020-04-04 20:21:29 +05:30
|
|
|
FROM openjdk:8-jre-alpine
|
|
|
|
|
2020-10-06 14:35:38 +03:00
|
|
|
RUN addgroup -S datahub && adduser -S datahub -G datahub
|
|
|
|
|
2020-04-04 20:21:29 +05:30
|
|
|
COPY --from=builder /datahub-frontend /datahub-frontend/
|
2020-10-06 14:35:38 +03:00
|
|
|
RUN chown -R datahub:datahub /datahub-frontend && chmod 755 /datahub-frontend
|
|
|
|
USER datahub
|
2021-02-10 16:10:08 -08:00
|
|
|
EXPOSE ${PORT:-9001}
|
2019-09-02 23:21:01 -07:00
|
|
|
|
2019-09-03 10:38:13 -07:00
|
|
|
ENV JAVA_OPTS=" \
|
|
|
|
-Xms512m \
|
|
|
|
-Xmx1024m \
|
2021-02-10 16:10:08 -08:00
|
|
|
-Dhttp.port=${PORT:-9001} \
|
2019-09-03 10:38:13 -07:00
|
|
|
-Dconfig.file=datahub-frontend/conf/application.conf \
|
|
|
|
-Djava.security.auth.login.config=datahub-frontend/conf/jaas.conf \
|
|
|
|
-Dlogback.configurationFile=datahub-frontend/conf/logback.xml \
|
2020-10-06 14:35:38 +03:00
|
|
|
-Dlogback.debug=true \
|
|
|
|
-Dpidfile.path=/datahub-frontend/play.pid"
|
2019-09-03 10:38:13 -07:00
|
|
|
CMD ["datahub-frontend/bin/playBinary"]
|