version: '3.8'

services:
  backend:
    build: ./backend
    ports:
      - "8000:8000"
    volumes:
      - ./backend:/app
      - sqlite_data:/app/data
      - receipts_data:/app/uploads/receipts
    environment:
      - DATABASE_URL=sqlite:///./data/juntete.db
      - DEBUG=true
    command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload

  frontend:
    build: ./frontend
    ports:
      - "3002:3000"
    volumes:
      - ./frontend:/app
      - /app/node_modules
    environment:
      - NEXT_PUBLIC_API_URL=http://localhost:8000
      - BACKEND_URL=http://backend:8000
    command: npm run dev
    depends_on:
      - backend

volumes:
  sqlite_data:
  receipts_data: