ARG PYTHON_REPO=containers.dev.maio.me/library/python
ARG PYTHON_TAG=latest

FROM ${PYTHON_REPO}:${PYTHON_TAG} AS test

# install requirements
ADD requirements*.txt setup.cfg ./
RUN apk add build-base && \
    pip install --no-cache-dir -r requirements.txt

# install assets
ADD assets/ /opt/resource/
ADD test/ /opt/resource-tests/

RUN /opt/resource-tests/test.sh

# ---

FROM ${PYTHON_REPO}:${PYTHON_TAG}

ADD requirements*.txt setup.cfg ./
ADD assets/ /opt/resource/

RUN pip install --no-cache-dir -r requirements.txt