Skip to content

Commit

Permalink
build: Reduce size of datahub-frontend-react image by 50-ish% (datahu…
Browse files Browse the repository at this point in the history
…b-project#10878)

Co-authored-by: david-leifker <[email protected]>
  • Loading branch information
xkollar and david-leifker authored Aug 1, 2024
1 parent 89933fe commit 2ab43f3
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions docker/datahub-frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,25 @@ RUN apk --no-cache --update-cache --available upgrade \

ENV LD_LIBRARY_PATH="/lib:/lib64"

FROM base as prod-install
FROM base as unpack

COPY ./datahub-frontend.zip /
RUN unzip datahub-frontend.zip -d /datahub-frontend \
&& mv /datahub-frontend/main/* /datahub-frontend \
&& rmdir /datahub-frontend/main \
&& rm datahub-frontend.zip
RUN unzip datahub-frontend.zip -d /tmp/out \
&& mv /tmp/out/main /datahub-frontend
COPY ./docker/monitoring/client-prometheus-config.yaml /datahub-frontend/
RUN chown -R datahub:datahub /datahub-frontend && chmod 755 /datahub-frontend

FROM base as prod-install

COPY --from=unpack /datahub-frontend/ /datahub-frontend/

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" ]

FROM ${APP_ENV}-install as final
COPY ./docker/datahub-frontend/start.sh /
RUN chown datahub:datahub /start.sh && chmod 755 /start.sh
COPY --chown=datahub:datahub --chmod=755 ./docker/datahub-frontend/start.sh /
USER datahub

ARG SERVER_PORT=9002
Expand Down

0 comments on commit 2ab43f3

Please sign in to comment.