## taller-wox.fitlabs.dev — Stack productivo Coolify
##
## Single container FastAPI. Coolify autodetecta este compose; el FQDN
## se setea en el panel del servicio `app` y Coolify completa las
## labels Traefik faltantes (router HTTPS, Let's Encrypt cert).

services:

  app:
    build:
      context: .
      dockerfile: Dockerfile
    image: taller-wox:latest
    restart: unless-stopped
    expose:
      - "8000"
    environment:
      SECRET_KEY: ${SECRET_KEY}
      ADMIN_USER: ${ADMIN_USER:-admin}
      ADMIN_PASS: ${ADMIN_PASS}
      TOKEN_EXPIRY_HOURS: ${TOKEN_EXPIRY_HOURS:-24}
      BASE_URL: ${BASE_URL:-https://taller-wox.fitlabs.dev}
      MATERIAL_DIR: /app/material
      DB_PATH: /app/db/leads.db
      REPORTS_OUTPUT_DIR: /app/app/data/reports_output
    volumes:
      - taller-wox-db:/app/db
      - taller-wox-reports:/app/app/data/reports_output
      - taller-wox-material:/app/material
    healthcheck:
      test: ["CMD", "curl", "-sf", "http://localhost:8000/health"]
      interval: 30s
      timeout: 5s
      retries: 3
      start_period: 15s
    labels:
      - "traefik.enable=true"
      - "traefik.docker.network=coolify"

volumes:
  taller-wox-db:
  taller-wox-reports:
  taller-wox-material:
