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
a194bb5
commit 5fb702b
Showing
1 changed file
with
12 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,25 +1,21 @@ | ||
| FROM python:3.9-slim | ||
| # Use an official Python runtime as a base image | ||
| FROM python:3.11-slim | ||
|
|
||
| # Set environment variables | ||
| ENV PYTHONDONTWRITEBYTECODE 1 | ||
| ENV PYTHONUNBUFFERED 1 | ||
| ENV PYTHONUNBUFFERED=1 | ||
|
|
||
| # Set the working directory | ||
| WORKDIR /app | ||
|
|
||
| # Install system dependencies | ||
| RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
| build-essential \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
| # Install system dependencies (if needed) | ||
| RUN apt-get update && apt-get install -y gcc libpq-dev && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # Copy backend files | ||
| # Copy dependencies file and install them | ||
| COPY ../requirements.txt . | ||
| COPY ../manage.py . | ||
| COPY ../app/ ./app # Changed from 'your_app' to 'app' | ||
| COPY ../config/ ./config # If you have Django config files | ||
| RUN pip install --no-cache-dir -r requirements.txt coverage | ||
|
|
||
| # Install dependencies | ||
| RUN pip install --no-cache-dir -r requirements.txt | ||
| RUN pip install coverage | ||
| # Copy the Django project | ||
| COPY ../ . | ||
|
|
||
| # Run tests | ||
| CMD ["sh", "-c", "coverage run --source='app' manage.py test && coverage xml && coverage html"] | ||
| # Run Django tests with coverage | ||
| CMD ["sh", "-c", "coverage run --source=. manage.py test && coverage report -m && coverage html"] |