ARG AWS_ACCOUNT=086679231553
FROM ${AWS_ACCOUNT}.dkr.ecr.us-east-1.amazonaws.com/docker-parent-images:python312 AS base

WORKDIR /var/app

USER root

# Update and install common packages
RUN apt-get update && apt-get install gcc curl git tar zip make -y

# Install pipenv
RUN pip install pipenv

# Add application and install requirements
COPY Pipfile Pipfile.lock /var/app/
RUN pipenv install --dev --ignore-pipfile --system

USER worker

COPY . /var/app/
COPY --chmod=755 tests-integration.sh /var/app/
COPY tests/integration/ /var/app/tests/integration/

ENTRYPOINT [ "/var/app/tests-integration.sh" ]
