FROM python:3.10-slim ENV POETRY_VERSION 1.4.1 # Install system dependencies RUN pip install "poetry==$POETRY_VERSION" --index-url https://pypi.tuna.tsinghua.edu.cn/simple # Set work directory WORKDIR /app # Copy only requirements to cache them in docker layer COPY poetry.lock pyproject.toml /app/ # Disable the creation of virtual environments RUN poetry config virtualenvs.create false # Install dependencies RUN poetry export -f requirements.txt --output requirements.txt --without-hashes RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt --index-url https://pypi.tuna.tsinghua.edu.cn/simple # Copy the current directory contents into the container at /app COPY ./ /app/