Dockerfile caching optimization

This commit is contained in:
Jörn-Michael Miehe 2023-09-20 19:04:43 +02:00
parent 855897eda7
commit 8093b78af1

View file

@ -21,6 +21,9 @@ RUN yarn build --dest /tmp/advent22_ui/html
FROM tiangolo/uvicorn-gunicorn:python3.11-slim AS production FROM tiangolo/uvicorn-gunicorn:python3.11-slim AS production
# add prepared advent22_ui
COPY --from=build-ui /tmp/advent22_ui /usr/local/share/advent22_ui
# env setup # env setup
WORKDIR /usr/local/src/advent22_api WORKDIR /usr/local/src/advent22_api
ENV \ ENV \
@ -37,8 +40,5 @@ RUN set -ex; \
\ \
python -m pip --no-cache-dir install ./ python -m pip --no-cache-dir install ./
# add prepared advent22_ui
COPY --from=build-ui /tmp/advent22_ui /usr/local/share/advent22_ui
# run as unprivileged user # run as unprivileged user
USER nobody USER nobody