services:
  db:
    image: postgres:16
    environment:
      POSTGRES_DB: monark
      POSTGRES_USER: monark
      POSTGRES_PASSWORD: monark
    ports:
      - "5432:5432"
    volumes:
      - monark_pg:/var/lib/postgresql/data

  api:
    image: python:3.11-slim
    working_dir: /app
    volumes:
      - ./../:/app
    command: bash -lc "pip install fastapi uvicorn psycopg[binary] && uvicorn monark.api.main:app --host 0.0.0.0 --port 8000"
    ports:
      - "8000:8000"
    depends_on:
      - db

volumes:
  monark_pg:
