forked from mathialm/secfit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Garima Ketan Chauhan
authored and
GitHub Enterprise
committed
Apr 2, 2025
1 parent
e466591
commit 8f71086
Showing
1 changed file
with
10 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,26 +1,20 @@ | ||
| # Use an official Python runtime as a parent image | ||
| FROM python:3.9-buster | ||
| FROM python:3.9-slim | ||
|
|
||
| # Set the working directory | ||
| # Set the working directory in the container | ||
| WORKDIR /app | ||
|
|
||
| # Add Google's public DNS for name resolution | ||
| RUN echo "nameserver 8.8.8.8" > /etc/resolv.conf | ||
|
|
||
| # Install system dependencies (including gcc and libpq-dev) | ||
| RUN apt-get update && \ | ||
| apt-get install -y apt-transport-https gcc libpq-dev && \ | ||
| rm -rf /var/lib/apt/lists/* | ||
| # Set environment variable to ensure unbuffered output (for better logging) | ||
| ENV PYTHONUNBUFFERED 1 | ||
|
|
||
| # Copy the requirements file into the container and install dependencies | ||
| # Copy the requirements file into the container | ||
| COPY requirements.txt /app/requirements.txt | ||
|
|
||
| # Install dependencies (including coverage) | ||
| RUN pip install --no-cache-dir -r /app/requirements.txt coverage | ||
|
|
||
| # Copy the rest of the application files | ||
| # Copy the entire codebase into the container | ||
| COPY . /app/ | ||
|
|
||
| # Set environment variables | ||
| ENV PYTHONUNBUFFERED 1 | ||
|
|
||
| # Run tests with coverage | ||
| CMD ["python", "manage.py", "test", "--coverage"] | ||
| # Run the tests with coverage | ||
| CMD ["python", "manage.py", "test", "--coverage", "--coverage-report=coverage.xml"] |