ARG AWS_ACCOUNT=086679231553
FROM ${AWS_ACCOUNT}.dkr.ecr.us-east-1.amazonaws.com/docker-parent-images:python311 AS base
USER root
RUN apt-get update && apt-get -y upgrade && apt-get -y install make
USER worker
WORKDIR /var/app
COPY requirements.txt ./

FROM base AS unit-lint
COPY requirements-dev.txt .flake8 setup.py Makefile ./
COPY examples ./examples
COPY kafka_utils ./kafka_utils
COPY tests ./tests
RUN make clean
ENTRYPOINT [ "make", "lint", "test_unit" ]

FROM base AS test-integration
COPY Makefile ./
COPY examples ./examples
COPY tests ./tests
COPY integration_tests.sh ./
RUN make clean
ENTRYPOINT [ "make", "test_integration" ]
