# pull official base image
ARG BASE_IMAGE
FROM ${BASE_IMAGE}

ENV DATABASE_TEST_URL=postgresql://postgres:postgres@api-db:5432/api_test

# add and install requirements
COPY --chown=python:python ./requirements.test.txt .
RUN python -m pip install -r requirements.test.txt

# add app
COPY --chown=python:python src/tests src/tests

# new
COPY --chown=python:python src/.cicd/test.sh .
RUN chmod +x /usr/src/app/test.sh

CMD ["/usr/src/app/test.sh"]