The final steps in the test stage are to copy the application source into the container and add support for running tests:
# Test stageFROM alpine AS testLABEL application=todobackend# Install basic utilitiesRUN apk add --no-cache bash git# Install build dependenciesRUN apk add --no-cache gcc python3-dev libffi-dev musl-dev linux-headers mariadb-devRUN pip3 install wheel# Copy requirementsCOPY /src/requirements* /build/WORKDIR /build# Build and install requirementsRUN pip3 wheel -r requirements_test.txt --no-cache-dir --no-inputRUN pip3 install -r requirements_test.txt -f /build --no-index --no-cache-dir# Copy source codeCOPY /src /appWORKDIR /app# Test entrypointCMD ["python3", "manage.py", "test", ...