services:
  app:
    build: .
    image: __APP_NAME__
    ports:
      - "5002:5002"
    env_file:
      - .env
    environment:
      - PORT=5002
      - NODE_ENV=production
      - AUTO_MIGRATE=true            # run db:sync + seed:rbac on boot
    volumes:
      - ./data:/app/data            # sqlite persistence (single-tenant/dev)
    restart: unless-stopped

  # For mysql/postgres tenancy, run a DB and point DB_URL (or the platform DB) at it:
  # db:
  #   image: postgres:16-bookworm
  #   environment:
  #     POSTGRES_USER: app
  #     POSTGRES_PASSWORD: app
  #     POSTGRES_DB: myapp
  #   volumes:
  #     - dbdata:/var/lib/postgresql/data
  #   ports: ["5432:5432"]
# volumes:
#   dbdata:
