Skip to content

Commit

Permalink
trying toslim down the image size
Browse files Browse the repository at this point in the history
  • Loading branch information
jblom committed Nov 6, 2023
1 parent 6d8d57e commit e8d5fa9
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ WORKDIR /src
RUN pip install --upgrade pip
RUN pip install poetry
COPY ./pyproject.toml /src
RUN poetry config virtualenvs.create false && poetry install --only main --no-interaction --no-ansi
RUN --mount=type=cache,target=/home/.cache/pypoetry/cache \
--mount=type=cache,target=/home/.cache/pypoetry/artifacts \
poetry config virtualenvs.create false && \
poetry install --only main --no-interaction --no-ansi

# copy the rest into the source dir
COPY ./ /src
Expand All @@ -22,3 +25,14 @@ COPY ./ /src
RUN echo "dane-visual-feature-extraction-worker;https://github.com/beeldengeluid/dane-visual-feature-extraction-worker/commit/$(git rev-parse HEAD)" >> /software_provenance.txt

ENTRYPOINT ["./docker-entrypoint.sh"]

# NOTE: RUN pip install --no-cache-dir torch should drop the image size

# OF: && pip cache purge (na poetry install command)

# syntax=docker/dockerfile:1.2

# COPY poetry.lock /
# RUN --mount=type=cache,target=/home/.cache/pypoetry/cache \
# --mount=type=cache,target=/home/.cache/pypoetry/artifacts \
# poetry install

0 comments on commit e8d5fa9

Please sign in to comment.