You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
741 B
25 lines
741 B
FROM python:3.12-slim-bookworm AS builder
|
|
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
|
|
ENV UV_HTTP_TIMEOUT=100 \
|
|
UV_NO_CACHE=1
|
|
WORKDIR /app
|
|
RUN uv pip install --system poetry poetry-plugin-export
|
|
COPY pyproject.toml poetry.lock ./
|
|
RUN uv venv /venv && \
|
|
poetry config warnings.export false && \
|
|
poetry export -f requirements.txt -o requirements.txt && \
|
|
VIRTUAL_ENV=/venv uv pip install -r requirements.txt
|
|
COPY . .
|
|
RUN poetry build && \
|
|
VIRTUAL_ENV=/venv uv pip install dist/*.whl
|
|
|
|
FROM python:3.12-slim-bookworm AS final
|
|
ENV PYTHONFAULTHANDLER=1 \
|
|
PYTHONHASHSEED=random \
|
|
PYTHONUNBUFFERED=1
|
|
WORKDIR /app
|
|
COPY --from=builder /venv /venv
|
|
ENV PATH="/venv/bin:${PATH}"
|
|
|
|
ENTRYPOINT [ "mitmproxy2swagger" ]
|