FROM python:3.12-alpine3.21

ENV PIP_DISABLE_PIP_VERSION_CHECK 1
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

WORKDIR /code

COPY ./requirements.txt ./requirements/prod.txt

RUN pip install --upgrade pip &&  \
    pip install -r requirements/prod.txt

COPY entrypoint.prod.sh .
USER root
RUN chmod +x /code/entrypoint.prod.sh

COPY . .
RUN chmod +x /code/entrypoint.prod.sh

ENTRYPOINT ["/code/entrypoint.prod.sh"]