2021-03-19 18:55:04 -04:00
|
|
|
# Defining environment
|
|
|
|
ARG APP_ENV=prod
|
2019-09-02 23:21:01 -07:00
|
|
|
|
2021-03-19 18:55:04 -04:00
|
|
|
FROM openjdk:8-jre-alpine as base
|
|
|
|
RUN addgroup -S datahub && adduser -S datahub -G datahub
|
2021-03-23 15:15:16 -07:00
|
|
|
RUN apk --no-cache add curl
|
2021-02-10 16:10:08 -08:00
|
|
|
|
2021-03-19 18:55:04 -04:00
|
|
|
FROM openjdk:8 as prod-build
|
2021-04-06 16:10:50 -07:00
|
|
|
ARG ENABLE_EMBER="false"
|
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-04-06 16:10:50 -07:00
|
|
|
RUN cd datahub-src && ./gradlew :datahub-frontend:dist -PenableEmber=${ENABLE_EMBER} \
|
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
|
|
|
|
|
2021-03-19 18:55:04 -04:00
|
|
|
FROM base as prod-install
|
|
|
|
COPY --from=prod-build /datahub-frontend /datahub-frontend/
|
|
|
|
RUN chown -R datahub:datahub /datahub-frontend && chmod 755 /datahub-frontend
|
2020-04-04 20:21:29 +05:30
|
|
|
|
2021-03-19 18:55:04 -04:00
|
|
|
FROM base as dev-install
|
|
|
|
# Dummy stage for development. Assumes code is built on your machine and mounted to this image.
|
|
|
|
# See this excellent thread https://github.com/docker/cli/issues/1134
|
|
|
|
VOLUME [ "/datahub-frontend" ]
|
2020-10-06 14:35:38 +03:00
|
|
|
|
2021-03-19 18:55:04 -04:00
|
|
|
FROM ${APP_ENV}-install as final
|
2020-10-06 14:35:38 +03:00
|
|
|
USER datahub
|
2021-02-17 23:11:32 -08:00
|
|
|
|
2021-03-18 09:55:05 -07:00
|
|
|
ARG SERVER_PORT=9002
|
2021-03-23 15:15:16 -07:00
|
|
|
ENV SERVER_PORT=$SERVER_PORT
|
2021-02-17 23:11:32 -08:00
|
|
|
RUN echo $SERVER_PORT
|
|
|
|
EXPOSE $SERVER_PORT
|
2019-09-02 23:21:01 -07:00
|
|
|
|
2021-03-23 15:15:16 -07:00
|
|
|
HEALTHCHECK --start-period=2m --retries=4 CMD curl --fail http://localhost:$SERVER_PORT/admin || exit 1
|
|
|
|
|
2019-09-03 10:38:13 -07:00
|
|
|
ENV JAVA_OPTS=" \
|
2021-02-17 23:11:32 -08:00
|
|
|
-Xms512m \
|
|
|
|
-Xmx1024m \
|
|
|
|
-Dhttp.port=$SERVER_PORT \
|
|
|
|
-Dconfig.file=datahub-frontend/conf/application.conf \
|
|
|
|
-Djava.security.auth.login.config=datahub-frontend/conf/jaas.conf \
|
|
|
|
-Dlogback.configurationFile=datahub-frontend/conf/logback.xml \
|
|
|
|
-Dlogback.debug=true \
|
2021-04-29 23:27:03 -07:00
|
|
|
-Dpidfile.path=/dev/null"
|
2021-02-17 23:11:32 -08:00
|
|
|
CMD ["datahub-frontend/bin/playBinary"]
|