diff --git a/backend/tests/Dockerfile.test b/backend/tests/Dockerfile.test index 7c28661..8a4bd4d 100644 --- a/backend/tests/Dockerfile.test +++ b/backend/tests/Dockerfile.test @@ -1,16 +1,14 @@ -# We Use an official Python runtime as a parent image -FROM python:3.12-slim +# Use a base Python image +FROM python:3.9-slim -# Allows docker to cache installed dependencies between builds -COPY requirements.txt requirements.txt -RUN pip install --no-cache-dir -r requirements.txt +# Set the working directory in the container +WORKDIR /app -# Mounts the application code to the image -RUN mkdir /app +# Copy the application code into the container COPY . /app -WORKDIR /app -EXPOSE 8000 +# Install dependencies (including coverage) +RUN pip install --no-cache-dir -r requirements.txt coverage -# Runs migrations and starts the server -CMD ["sh", "-c", "python manage.py migrate && python manage.py runserver 0.0.0.0:8000"] +# Run Django tests with coverage +CMD coverage run manage.py test