Pranit commited on
Commit
be8aeda
·
1 Parent(s): 2c2d1c2
Dockerfile CHANGED
@@ -18,9 +18,19 @@ RUN apt-get update && apt-get install -y \
18
  shared-mime-info \
19
  && rm -rf /var/lib/apt/lists/*
20
 
 
21
  COPY requirements.txt .
22
  RUN pip install --no-cache-dir -r requirements.txt
23
 
 
24
  COPY . .
25
 
26
- CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]
 
 
 
 
 
 
 
 
 
18
  shared-mime-info \
19
  && rm -rf /var/lib/apt/lists/*
20
 
21
+ # Copy requirements first to leverage Docker cache
22
  COPY requirements.txt .
23
  RUN pip install --no-cache-dir -r requirements.txt
24
 
25
+ # Copy application code
26
  COPY . .
27
 
28
+ # Create templates directory if it doesn't exist
29
+ RUN mkdir -p templates
30
+
31
+ # Set environment variables
32
+ ENV FLASK_APP=app.py
33
+ ENV FLASK_ENV=production
34
+
35
+ # Run gunicorn
36
+ CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--timeout", "300", "app:app"]
requirements.txt CHANGED
@@ -1,5 +1,7 @@
1
  flask==2.0.1
 
2
  google-generativeai==0.3.2
3
  weasyprint==60.1
4
  Jinja2==3.0.1
5
- gunicorn==21.2.0
 
 
1
  flask==2.0.1
2
+ werkzeug==2.0.3
3
  google-generativeai==0.3.2
4
  weasyprint==60.1
5
  Jinja2==3.0.1
6
+ gunicorn==21.2.0
7
+ python-dotenv==1.0.0
templates/campus-inspection-report.html ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Campus Inspection Report</title>
5
+ <style>
6
+ body { font-family: Arial, sans-serif; }
7
+ .report-header { text-align: center; }
8
+ .finding { margin: 20px 0; }
9
+ </style>
10
+ </head>
11
+ <body>
12
+ <div class="report-header">
13
+ <h1>Campus Inspection Report</h1>
14
+ <p>Generated on: {{timestamp}}</p>
15
+ <p>Inspector: {{inspector_name}}</p>
16
+ <p>Location: {{location}}</p>
17
+ <p>Weather Conditions: {{weather}}</p>
18
+ </div>
19
+
20
+ <div class="findings">
21
+ {% for finding in findings %}
22
+ <div class="finding">
23
+ <h3>{{finding.title}}</h3>
24
+ <p><strong>Severity:</strong> {{finding.severity}}</p>
25
+ <p><strong>Description:</strong> {{finding.description}}</p>
26
+ <p><strong>Recommendation:</strong> {{finding.recommendation}}</p>
27
+ {% if finding.image_path %}
28
+ <img src="{{finding.image_path}}" alt="Finding Image" style="max-width: 400px;">
29
+ {% endif %}
30
+ </div>
31
+ {% endfor %}
32
+ </div>
33
+ </body>
34
+ </html>