bug(docker react): Fix react docker image build (#2118)

Co-authored-by: John Joyce <john@acryl.io>
This commit is contained in:
John Joyce 2021-02-17 23:11:32 -08:00 committed by GitHub
parent 02ffa6fd54
commit 1aede64465
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 14 deletions

View File

@ -54,4 +54,4 @@ jobs:
repository: linkedin/datahub-frontend
tags: ${{ needs.setup.outputs.tag }}
push: ${{ needs.setup.outputs.publish == 'true' }}
build_args: ENABLE_REACT=true,PORT=9002
build_args: SERVER_PORT=9002,ENABLE_REACT=true

View File

@ -1,7 +1,6 @@
FROM openjdk:8 as builder
ARG ENABLE_REACT
ARG PORT
ARG ENABLE_REACT="false"
RUN apt-get update && apt-get install -y wget \
&& wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
@ -21,15 +20,19 @@ RUN addgroup -S datahub && adduser -S datahub -G datahub
COPY --from=builder /datahub-frontend /datahub-frontend/
RUN chown -R datahub:datahub /datahub-frontend && chmod 755 /datahub-frontend
USER datahub
EXPOSE ${PORT:-9001}
ARG SERVER_PORT=9001
RUN echo $SERVER_PORT
EXPOSE $SERVER_PORT
ENV JAVA_OPTS=" \
-Xms512m \
-Xmx1024m \
-Dhttp.port=${PORT:-9001} \
-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 \
-Dpidfile.path=/datahub-frontend/play.pid"
CMD ["datahub-frontend/bin/playBinary"]
-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 \
-Dpidfile.path=/datahub-frontend/play.pid"
CMD ["datahub-frontend/bin/playBinary"]

View File

@ -7,8 +7,8 @@ services:
context: ../
dockerfile: docker/datahub-frontend/Dockerfile
args:
SERVER_PORT: 9002
ENABLE_REACT: "true"
PORT: 9002
image: linkedin/datahub-frontend:react-${DATAHUB_VERSION:-latest}
env_file: datahub-frontend/env/docker.env
hostname: datahub-frontend-react