43 lines
1.4 KiB
Plaintext
43 lines
1.4 KiB
Plaintext
FROM python:3.10
|
|
|
|
ARG USERNAME
|
|
ARG TOKEN
|
|
ARG PYPI_REGISTRY_RESEARCH=https://gitlab.knecon.com/api/v4/groups/19/-/packages/pypi
|
|
ARG POETRY_SOURCE_REF_RESEARCH=gitlab-research
|
|
ARG PYPI_REGISTRY_RED=https://gitlab.knecon.com/api/v4/groups/12/-/packages/pypi
|
|
ARG POETRY_SOURCE_REF_RED=gitlab-red
|
|
ARG VERSION=dev
|
|
|
|
LABEL maintainer="Research <research@knecon.com>"
|
|
LABEL version="${VERSION}"
|
|
|
|
WORKDIR /app
|
|
|
|
ENV PYTHONUNBUFFERED=true
|
|
ENV POETRY_HOME=/opt/poetry
|
|
ENV PATH="$POETRY_HOME/bin:$PATH"
|
|
|
|
RUN curl -sSL https://install.python-poetry.org | python3 -
|
|
|
|
COPY ./data ./data
|
|
COPY ./image_prediction ./image_prediction
|
|
COPY ./test ./test
|
|
COPY pyproject.toml poetry.lock banner.txt config.yaml ./src ./
|
|
|
|
RUN poetry config virtualenvs.create false && \
|
|
poetry config installer.max-workers 10 && \
|
|
poetry config repositories.${POETRY_SOURCE_REF_RESEARCH} ${PYPI_REGISTRY_RESEARCH} && \
|
|
poetry config http-basic.${POETRY_SOURCE_REF_RESEARCH} ${USERNAME} ${TOKEN} && \
|
|
poetry config repositories.${POETRY_SOURCE_REF_RED} ${PYPI_REGISTRY_RED} && \
|
|
poetry config http-basic.${POETRY_SOURCE_REF_RED} ${USERNAME} ${TOKEN} && \
|
|
poetry install --without=dev -vv --no-interaction --no-root
|
|
|
|
EXPOSE 5000
|
|
EXPOSE 8080
|
|
|
|
RUN apt update --yes
|
|
RUN apt install vim --yes
|
|
RUN apt install poppler-utils --yes
|
|
|
|
CMD coverage run -m pytest test/ --tb=native -q -s -vvv -x && coverage combine && coverage report -m && coverage xml
|