diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..a44ca60 Binary files /dev/null and b/.DS_Store differ diff --git a/Dockerfile b/Dockerfile index 33730b6..de2fd00 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,8 @@ -# Dockerfile FROM python:3.12-slim # Set environment variables -ENV PYTHONDONTWRITEBYTECODE 1 -ENV PYTHONUNBUFFERED 1 +ENV PYTHONDONTWRITEBYTECODE=1 +ENV PYTHONUNBUFFERED=1 # Set working directory WORKDIR /cost-assistant @@ -11,7 +10,14 @@ WORKDIR /cost-assistant # Copy requirements first (for caching) COPY requirements.txt . -# Install dependencies +# Install system dependencies: OpenCV, Poppler, and minimal utils +RUN apt-get update && apt-get install -y \ + libgl1 \ + libglib2.0-0 \ + poppler-utils \ + && rm -rf /var/lib/apt/lists/* + +# Install Python dependencies RUN pip install --no-cache-dir -r requirements.txt # Copy the project files @@ -23,5 +29,5 @@ RUN mkdir -p data/uploads # Expose port EXPOSE 8000 -# Run FastAPI with Uvicorn +# Run FastAPI with Uvicorn (reload for dev) CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"] diff --git a/__pycache__/cost_calculator.cpython-313.pyc b/__pycache__/cost_calculator.cpython-313.pyc new file mode 100644 index 0000000..909bf59 Binary files /dev/null and b/__pycache__/cost_calculator.cpython-313.pyc differ diff --git a/__pycache__/mailer.cpython-313.pyc b/__pycache__/mailer.cpython-313.pyc new file mode 100644 index 0000000..53f1596 Binary files /dev/null and b/__pycache__/mailer.cpython-313.pyc differ diff --git a/__pycache__/main.cpython-313.pyc b/__pycache__/main.cpython-313.pyc new file mode 100644 index 0000000..2c55984 Binary files /dev/null and b/__pycache__/main.cpython-313.pyc differ diff --git a/archive/result.html b/archive/result.html new file mode 100644 index 0000000..0a9118b --- /dev/null +++ b/archive/result.html @@ -0,0 +1,111 @@ + + + + +
+ +| Page | +Width (m) | +Height (m) | +Area (m²) | +Ink % | +Type | +Cost (€) | +
|---|---|---|---|---|---|---|
| {{ page.page }} | +{{ "%.3f"|format(page.width_m) }} | +{{ "%.3f"|format(page.height_m) }} | +{{ "%.4f"|format(page.area_m2) }} | +{{ "%.1f"|format(page.ink_pct) if page.ink_pct is not none else '-' }} | +{{ 'Color' if page.is_color else 'B&W' }} | +{{ "%.2f"|format(page.cost) }} | +
| Total Black Pages | +{{ "%.4f"|format(result.total_area_black) }} | ++ | {{ "%.2f"|format(result.total_cost_black) }} | +|||
| Total Color Pages | +{{ "%.4f"|format(result.total_area_color) }} | ++ | {{ "%.2f"|format(result.total_cost_color) }} | +|||
| Grand Total | +{{ "%.2f"|format(result.grand_total) }} | +|||||
{{ error }}
+{{ error }}
{% endif %}