ARG AWS_ACCOUNT=437795906767

FROM ${AWS_ACCOUNT}.dkr.ecr.us-east-1.amazonaws.com/docker-parent-images:python38
WORKDIR /var/app

# Presence of these environment variables is required to install
# dbt dependencies below
ARG SNOWFLAKE_USER=
ARG SNOWFLAKE_PASSWORD=
ARG SNOWFLAKE_ROLE=
ARG SNOWFLAKE_DATABASE=
ARG SNOWFLAKE_WAREHOUSE=
ARG SNOWFLAKE_SCHEMA=

# Update and install common packages
RUN yum -y update
RUN yum -y install curl gcc git tar zip which make

# Install postgres dependencies
RUN yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
RUN yum -y install libpq5-devel

RUN localedef -c -f UTF-8 -i en_US en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
ENV LANG=en_US.UTF-8

COPY . /var/app

ENV VIRTUAL_ENV /var/venv
RUN python3.8 -m venv ${VIRTUAL_ENV}
ENV PATH "$VIRTUAL_ENV/bin:$PATH"
RUN pip install -r requirements.txt

CMD ["python3.8","test_pipenv.py"]
