Trying to understand how to containerize my application. Error: failed to solve: process "/bin/sh -c python -m pip install -r requirements.txt" did not complete successfully: exit code: 1

I am trying to containerize my first application. After looking at the docker 2022 video on how to get started the instructor containerizes his first application.

I have just begun to understand the individual parts of what makes a docker file. FROM, etc.
I was following along and he started making individual statements and keywords to build the file but it seems in 2023 docker introduced functionality whenever you type in docker init. So I followed the documentation steps and typed in docker init and selected the prompts. It seems however the defaults are not working.

What have I tried and what am I expecting? I looked on stack overflow and they were talking about not running multiple docker runs as that creates layers. I am expecting my website to load but the erorr message says it has something to do with my requirements. Do I alter my requirements.txt? Maybe do that django command I heard so much about where you can order django to scan your requirements and build the requirments.txt file for you? Or is this is an issue with how I made my dockerfile? Any advice would be welcomed. Where is the issue coming from?

Documentation instructions:

error message

andrewstribling@Andrews-MBP djangodelights % docker compose up --build
[+] Building 6.1s (10/11)                                                                             
 => [server internal] load .dockerignore                                                         0.0s
 => => transferring context: 680B                                                                0.0s
 => [server internal] load build definition from Dockerfile                                      0.1s
 => => transferring dockerfile: 1.55kB                                                           0.0s
 => [server] resolve image config for                              0.8s
 => CACHED [server] docker-image://  0.0s
 => [server internal] load metadata for                          0.0s
 => [server stage-0 1/5] FROM                                    0.0s
 => [server internal] load build context                                                         1.8s
 => => transferring context: 750.25kB                                                            1.8s
 => CACHED [server stage-0 2/5] WORKDIR /app                                                     0.0s
 => CACHED [server stage-0 3/5] RUN adduser     --disabled-password     --gecos ""     --home "  0.0s
 => ERROR [server stage-0 4/5] RUN --mount=type=cache,target=/root/.cache/pip     --mount=type=  3.1s


# syntax=docker/dockerfile:1

# Comments are provided throughout this file to help you get started.
# If you need more help, visit the Dockerfile reference guide at

FROM python

# Prevents Python from writing pyc files.

# Keeps Python from buffering stdout and stderr to avoid situations where
# the application crashes without emitting any logs due to buffering.


# Create a non-privileged user that the app will run under.
# See
ARG UID=10001
RUN adduser \
    --disabled-password \
    --gecos "" \
    --home "/nonexistent" \
    --shell "/sbin/nologin" \
    --no-create-home \
    --uid "${UID}" \

# Download dependencies as a separate step to take advantage of Docker's caching.
# Leverage a cache mount to /root/.cache/pip to speed up subsequent builds.
# Leverage a bind mount to requirements.txt to avoid having to copy them into
# into this layer.
RUN --mount=type=cache,target=/root/.cache/pip \
    --mount=type=bind,source=requirements.txt,target=requirements.txt \
    python -m pip install -r requirements.txt

# Switch to the non-privileged user to run the application.
USER appuser

# Copy the source code into the container.
COPY . .

# Expose the port that the application listens on.

# Run the application.
CMD python3 runserver

Link to my Github: GitHub - strikeouts27/djangodelights