FROM ghcr.io/mlflow/mlflow:v3.10.1 USER root RUN mkdir -p /mlflow/artifacts RUN useradd -m -u 1000 mlflow RUN chown -R mlflow:mlflow /mlflow USER mlflow RUN pip install --upgrade pip RUN pip install --no-cache-dir psycopg2-binary boto3 EXPOSE 7860 # ── ENV (surchargeables via HF Spaces Settings → Variables/Secrets) ──────── ENV MLFLOW_BACKEND_STORE_URI="sqlite:////mlflow/mlflow.db" # Bucket HF (S3-compatible) — namespace dans l'endpoint, bucket seul dans l'URI ENV MLFLOW_S3_ENDPOINT_URL="https://s3.hf.co/Frederic-CellNum" ENV MLFLOW_ARTIFACT_ROOT="s3://mlflow_fraud-storage/" ENV AWS_DEFAULT_REGION="us-east-1" ENV AWS_ACCESS_KEY_ID="" ENV AWS_SECRET_ACCESS_KEY="" # Requis pour les versions récentes de boto3 — la passerelle HF ne gère pas # les checksums trailing CRC32 (aws-chunked) envoyés par défaut ENV AWS_REQUEST_CHECKSUM_CALCULATION="when_required" ENV AWS_RESPONSE_CHECKSUM_VALIDATION="when_required" CMD mlflow server --host 0.0.0.0 \ --port 7860 \ --backend-store-uri "$MLFLOW_BACKEND_STORE_URI" \ --default-artifact-root "$MLFLOW_ARTIFACT_ROOT" \ --allowed-hosts "*" \ --cors-allowed-origins "*"