verbanote-server/Dockerfile

53 lines
1.2 KiB
Docker
Raw Normal View History

2023-08-20 10:31:49 +00:00
ARG PYTHON_VERSION=3.11.0
2023-08-20 12:36:30 +00:00
ARG POETRY_VERSION=1.5.0
2023-08-20 10:31:49 +00:00
FROM python:${PYTHON_VERSION} as staging
ARG APP_NAME=verbanote
ARG APP_PATH=/verbanote
ARG PYTHON_VERSION
ARG POETRY_VERSION
ARG VERBANOTE_OUTPUT_PATH=/transcriptions
ENV \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PYTHONFAULTHANDLER=1
ENV \
POETRY_VERSION=${POETRY_VERSION} \
POETRY_HOME=/opt/poetry \
POETRY_VIRTUALENVS_IN_PROJECT=true \
POETRY_NO_INTERACTION=1
# installing poetry
RUN curl -sSL https://install.python-poetry.org | python3 -
ENV PATH="${POETRY_HOME}/bin:${PATH}"
2023-08-20 11:28:31 +00:00
2023-08-20 10:31:49 +00:00
WORKDIR ${APP_PATH}
COPY ./poetry.lock ./pyproject.toml ./README.md ./
2023-08-20 10:31:49 +00:00
COPY ./${APP_NAME} ./${APP_NAME}
# --------------
FROM staging as worker
ARG APP_NAME
ARG APP_PATH
ARG VERBANOTE_OUTPUT_PATH
ENV APP_NAME=${APP_NAME}
ENV APP_PATH=${APP_PATH}
ENV VERBANOTE_OUTPUT_PATH=${VERBANOTE_OUTPUT_PATH}
WORKDIR ${APP_PATH}
RUN poetry install
RUN mkdir -p ${VERBANOTE_OUTPUT_PATH}
# installing the large models
RUN poetry run ltt install torch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1
2023-08-20 10:31:49 +00:00
COPY ./docker/docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT [ "/docker-entrypoint.sh" ]
CMD [ "python", "-u", "${APP_PATH}/{${APP_NAME}/rp_handler.py" ]