Skip to content

Commit

Permalink
Update Dockerfile.test
Browse files Browse the repository at this point in the history
This is to run the coverage module through docker
  • Loading branch information
Gargi Ketan Chauhan authored and GitHub Enterprise committed Apr 2, 2025
1 parent ecdba2d commit 608c8ab
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions backend/tests/Dockerfile.test
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
# We Use an official Python runtime as a parent image
# dockerfile.test
FROM python:3.12-slim

# Allows docker to cache installed dependencies between builds
COPY requirements.txt requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# Mounts the application code to the image
RUN pip install coverage

RUN mkdir /app
COPY . /app
WORKDIR /app

EXPOSE 8000

# Runs migrations and starts the server
CMD ["sh", "-c", "python manage.py migrate && python manage.py runserver 0.0.0.0:8000"]
CMD ["sh", "-c", "coverage run --source='.' manage.py test && coverage report"]

0 comments on commit 608c8ab

Please sign in to comment.