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.
mitmproxy2swagger/Dockerfile

27 lines
777 B

FROM python:3.10-alpine as base
ENV PYTHONFAULTHANDLER=1 \
PYTHONHASHSEED=random \
PYTHONUNBUFFERED=1
FROM python:3.10-alpine AS builder
ENV PIP_DEFAULT_TIMEOUT=100 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
2 years ago
PIP_NO_CACHE_DIR=1
2 years ago
WORKDIR /app
RUN apk update && \
apk upgrade && \
apk add gcc libc-dev libffi-dev cargo alpine-sdk bsd-compat-headers && \
2 years ago
python -m pip install --upgrade pip && \
pip install poetry
RUN python -m venv /venv
2 years ago
COPY ["pyproject.toml", "./"]
COPY ["poetry.lock", "./"]
RUN poetry export -f requirements.txt | /venv/bin/pip install -r /dev/stdin
2 years ago
COPY . .
RUN poetry build && /venv/bin/pip install dist/*.whl
2 years ago
FROM base AS final
WORKDIR /app
COPY --from=builder /venv /venv
ENV PATH="/venv/bin:${PATH}"
2 years ago
CMD [ "mitmproxy2swagger" ]