FROM python:3.8

WORKDIR /usr/src/app

ARG USER_ID
ARG GROUP_ID

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

COPY . .
COPY setup.py ./

RUN addgroup --gid $GROUP_ID user
RUN adduser --disabled-password --gecos '' --uid $USER_ID --gid $GROUP_ID user

USER user

RUN python ./setup.py


ENTRYPOINT ["python", "./entrypoint.py"]