- Complete MVP for tracking Fidelity brokerage account performance - Transaction import from CSV with deduplication - Automatic FIFO position tracking with options support - Real-time P&L calculations with market data caching - Dashboard with timeframe filtering (30/90/180 days, 1 year, YTD, all time) - Docker-based deployment with PostgreSQL backend - React/TypeScript frontend with TailwindCSS - FastAPI backend with SQLAlchemy ORM Features: - Multi-account support - Import via CSV upload or filesystem - Open and closed position tracking - Balance history charting - Performance analytics and metrics - Top trades analysis - Responsive UI design Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
43 lines
944 B
Docker
43 lines
944 B
Docker
# Multi-stage build for Python FastAPI backend
|
|
FROM python:3.11-slim as builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Install system dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
gcc \
|
|
postgresql-client \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Copy requirements and install Python dependencies
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir --user -r requirements.txt
|
|
|
|
# Final stage
|
|
FROM python:3.11-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# Install runtime dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
postgresql-client \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Copy Python dependencies from builder
|
|
COPY --from=builder /root/.local /root/.local
|
|
|
|
# Copy application code
|
|
COPY . .
|
|
|
|
# Make sure scripts in .local are usable
|
|
ENV PATH=/root/.local/bin:$PATH
|
|
|
|
# Create imports directory
|
|
RUN mkdir -p /app/imports
|
|
|
|
# Expose port
|
|
EXPOSE 8000
|
|
|
|
# Run migrations and start server
|
|
CMD alembic upgrade head && uvicorn app.main:app --host 0.0.0.0 --port 8000
|