FROM python:3.8

ENV DockerHOME=/home/app/webapp
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

RUN mkdir -p $DockerHOME
WORKDIR $DockerHOME

#RUN pip install --upgrade pip
RUN pip install "pip<24.1"
COPY requirements.txt .
RUN pip install -r requirements.txt

COPY . .

EXPOSE 8000

# Use a shell script or combined command for runtime tasks
CMD python manage.py makemigrations && python manage.py migrate && python manage.py runserver 0.0.0.0:8000
