Poetrify Dockerfile
This commit is contained in:
parent
64639bce6d
commit
aee7ee9b97
42
Dockerfile
42
Dockerfile
@ -1,30 +1,30 @@
|
||||
FROM python:3.10
|
||||
FROM python:3.8
|
||||
|
||||
RUN python -m venv /app/venv
|
||||
ENV PATH="/app/venv/bin:$PATH"
|
||||
|
||||
RUN python -m pip install --upgrade pip
|
||||
ARG YOUR_ENV
|
||||
|
||||
WORKDIR /app/service
|
||||
|
||||
COPY ./requirements.txt ./requirements.txt
|
||||
RUN python3 -m pip install -r requirements.txt
|
||||
|
||||
COPY ./incl/pyinfra/requirements.txt ./incl/pyinfra/requirements.txt
|
||||
RUN python -m pip install -r incl/pyinfra/requirements.txt
|
||||
|
||||
COPY ./incl/pdf2image/requirements.txt ./incl/pdf2image/requirements.txt
|
||||
RUN python -m pip install -r incl/pdf2image/requirements.txt
|
||||
|
||||
COPY ./incl ./incl
|
||||
|
||||
RUN python3 -m pip install -e incl/pyinfra
|
||||
RUN python3 -m pip install -e incl/pdf2image
|
||||
|
||||
COPY ./src ./src
|
||||
COPY ./cv_analysis ./cv_analysis
|
||||
COPY ./setup.py ./setup.py
|
||||
COPY pyproject.toml .
|
||||
COPY poetry.lock .
|
||||
|
||||
RUN python3 -m pip install -e .
|
||||
ENV YOUR_ENV=${YOUR_ENV} \
|
||||
PYTHONFAULTHANDLER=1 \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
PYTHONHASHSEED=random \
|
||||
PIP_NO_CACHE_DIR=off \
|
||||
PIP_DISABLE_PIP_VERSION_CHECK=on \
|
||||
PIP_DEFAULT_TIMEOUT=100 \
|
||||
POETRY_VERSION=1.2.2
|
||||
|
||||
# System deps:
|
||||
RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/etc/poetry python3 -
|
||||
ENV PATH="$PATH:/etc/poetry/bin/"
|
||||
RUN poetry --version
|
||||
|
||||
# Project initialization:
|
||||
RUN poetry config virtualenvs.create false
|
||||
RUN poetry install --no-interaction --no-ansi
|
||||
|
||||
CMD ["python3", "-u", "src/serve.py"]
|
||||
Loading…
x
Reference in New Issue
Block a user