Make Dockerfile layers more efficient

This commit is contained in:
Marty Oehme 2023-08-22 10:02:08 +02:00
parent 431c4bea2a
commit 6e4ed87813
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A
2 changed files with 5 additions and 4 deletions

View file

@ -7,7 +7,6 @@ ARG APP_NAME=verbanote
ARG APP_PATH=/verbanote ARG APP_PATH=/verbanote
ARG PYTHON_VERSION ARG PYTHON_VERSION
ARG POETRY_VERSION ARG POETRY_VERSION
ARG VERBANOTE_OUTPUT_PATH=/transcriptions
ENV \ ENV \
PYTHONDONTWRITEBYTECODE=1 \ PYTHONDONTWRITEBYTECODE=1 \
@ -26,7 +25,6 @@ ENV PATH="${POETRY_HOME}/bin:${PATH}"
WORKDIR ${APP_PATH} WORKDIR ${APP_PATH}
COPY ./poetry.lock ./pyproject.toml ./README.md ./ COPY ./poetry.lock ./pyproject.toml ./README.md ./
COPY ./${APP_NAME} ./${APP_NAME}
# -------------- # --------------
@ -38,13 +36,16 @@ ENV APP_NAME=${APP_NAME}
ENV APP_PATH=${APP_PATH} ENV APP_PATH=${APP_PATH}
ENV VERBANOTE_OUTPUT_PATH=${VERBANOTE_OUTPUT_PATH} ENV VERBANOTE_OUTPUT_PATH=${VERBANOTE_OUTPUT_PATH}
RUN mkdir -p ${VERBANOTE_OUTPUT_PATH}
WORKDIR ${APP_PATH} WORKDIR ${APP_PATH}
RUN poetry install RUN poetry install
RUN mkdir -p ${VERBANOTE_OUTPUT_PATH}
# installing the large models # installing the large models
RUN poetry run ltt install torch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 RUN poetry run ltt install torch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1
COPY ./${APP_NAME} ./${APP_NAME}
COPY ./docker/docker-entrypoint.sh /docker-entrypoint.sh COPY ./docker/docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT [ "/docker-entrypoint.sh" ] ENTRYPOINT [ "/docker-entrypoint.sh" ]

View file

@ -4,7 +4,7 @@ version = "0.1.0"
description = "" description = ""
authors = ["Marty Oehme <marty.oehme@gmail.com>"] authors = ["Marty Oehme <marty.oehme@gmail.com>"]
readme = "README.md" readme = "README.md"
packages = [{ include = "verbanote" }] # packages = [{ include = "verbanote" }]
[tool.poetry.dependencies] [tool.poetry.dependencies]
python = "^3.11" python = "^3.11"