Files
admin c1e22da9d6 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>
2026-03-26 08:37:01 +13:00

35 lines
1.1 KiB
Docker

# ── 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"]