FROM python:3.10-alpine

RUN apk add --no-cache \
      curl \
      gcc \
      libressl-dev \
      musl-dev \
      libffi-dev \
    && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal \
    && source $HOME/.cargo/env \
    && curl -sSL https://install.python-poetry.org | python3 - --preview \
    && ln -fs /root/.local/bin/poetry /usr/local/bin \
    && rm -rf /root/.rustup \
    && apk del \
        curl \
        gcc \
        libressl-dev \
        musl-dev \
        libffi-dev
