FROM 483193324480.dkr.ecr.us-east-1.amazonaws.com/python:3.8-slim-builder

WORKDIR /usr/local/src/flask-atlas-auth

COPY requirements/ requirements/
COPY configs/pip.conf /venv/
COPY configs/.pypirc /root/.pypirc
COPY setup.py setup.py
COPY pyproject.toml pyproject.toml

RUN python -m venv /venv \
    && . /venv/bin/activate \
    && pip --no-cache-dir install --upgrade pip setuptools wheel \
    && pip --no-cache-dir wheel --wheel-dir=/tmp/wheelhouse -r requirements/local.txt \
    && pip --no-cache-dir wheel --wheel-dir=/tmp/wheelhouse -r requirements/test.txt \
    && pip --no-cache-dir install --trusted-host pypi.python.org --no-index --find-links=/tmp/wheelhouse -r requirements/local.txt \
    && twine --version \
    && pip --no-cache-dir install --trusted-host pypi.python.org --no-index --find-links=/tmp/wheelhouse -r requirements/test.txt

COPY . .
