Initial commit — AmexPal statement analyser
Python/Flask backend with pdfplumber parser, Svelte 4 frontend, Docker multi-stage build. Includes category analysis, insights, monthly/weekly charts, subscription audit, and annualised projections. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+34
@@ -0,0 +1,34 @@
|
||||
# ── Stage 1: Build Svelte frontend ───────────────────────────────────────────
|
||||
FROM node:20-alpine AS frontend-build
|
||||
|
||||
WORKDIR /app/frontend
|
||||
|
||||
COPY frontend/package.json frontend/package-lock.json ./
|
||||
RUN npm ci
|
||||
|
||||
COPY frontend/ .
|
||||
RUN npm run build
|
||||
|
||||
|
||||
# ── Stage 2: Python / Flask ───────────────────────────────────────────────────
|
||||
FROM python:3.12-slim
|
||||
|
||||
# pdfplumber needs these system libs
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
libpoppler-cpp-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY amex_parser.py amex_analyser.py app.py ./
|
||||
|
||||
# Copy the built frontend from Stage 1
|
||||
COPY --from=frontend-build /app/frontend/dist ./frontend/dist
|
||||
|
||||
EXPOSE 5000
|
||||
|
||||
# Gunicorn for production (threaded, no debug mode)
|
||||
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "--workers", "2", "--threads", "4", "--timeout", "120", "app:app"]
|
||||
Reference in New Issue
Block a user