Skip to content

Commit

Permalink
Update Dockerfile.test
Browse files Browse the repository at this point in the history
  • Loading branch information
Garima Ketan Chauhan authored and GitHub Enterprise committed Apr 2, 2025
1 parent cedc4c7 commit 9d9fd81
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions backend/tests/Dockerfile.test
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# Use an official Python runtime as a parent image
FROM python:3.9-slim
FROM python:3.12-slim

# Set the working directory in the container
# Set the working directory to /app
WORKDIR /app

# Set environment variable to ensure unbuffered output (for better logging)
ENV PYTHONUNBUFFERED 1
# Copy the requirements file from the root directory to the container
COPY ../requirements.txt /app/requirements.txt

# Copy the requirements file into the container
COPY requirements.txt /app/requirements.txt

# Install dependencies (including coverage)
# Install dependencies including 'coverage'
RUN pip install --no-cache-dir -r /app/requirements.txt coverage

# Copy the entire codebase into the container
COPY . /app/
# Copy the application code into the container
COPY . /app

# Expose the application port (optional, if you plan to run it with a server)
EXPOSE 8000

# Run the tests with coverage
CMD ["python", "manage.py", "test", "--coverage", "--coverage-report=coverage.xml"]
# Run tests with coverage and generate a report
CMD ["sh", "-c", "coverage run --source='.' manage.py test && coverage report"]

0 comments on commit 9d9fd81

Please sign in to comment.