Omarelrayes commited on
Commit
b42a54f
·
verified ·
1 Parent(s): ecfe0f7

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -10
Dockerfile CHANGED
@@ -6,16 +6,23 @@ RUN pip install --no-cache-dir mlflow huggingface_hub
6
  # Expose port
7
  EXPOSE 7860
8
 
9
- # Environment variables (will be set in Space Settings)
10
  ENV HF_TOKEN=${HF_TOKEN}
11
  ENV MLFLOW_HF_ARTIFACT_REPO=${MLFLOW_HF_ARTIFACT_REPO}
 
12
 
13
- # Start MLflow server with HuggingFace Hub as artifact store
14
- CMD mlflow server \
15
- --host 0.0.0.0 \
16
- --port 7860 \
17
- --backend-store-uri sqlite:///mlflow.db \
18
- --default-artifact-root ${MLFLOW_HF_ARTIFACT_REPO:-hf://models/omarelrayes/mlflow-artifacts} \
19
- --serve-artifacts \
20
- --allowed-hosts "*" \
21
- --cors-allowed-origins "*"
 
 
 
 
 
 
 
6
  # Expose port
7
  EXPOSE 7860
8
 
9
+ # Environment variables
10
  ENV HF_TOKEN=${HF_TOKEN}
11
  ENV MLFLOW_HF_ARTIFACT_REPO=${MLFLOW_HF_ARTIFACT_REPO}
12
+ ENV PYTHONPATH=/app:${PYTHONPATH}
13
 
14
+ # Copy custom artifact repository
15
+ WORKDIR /app
16
+ COPY hf_artifact_repo.py .
17
+ COPY __init__.py .
18
+
19
+ # Import the custom repository before starting MLflow
20
+ CMD python -c "import hf_artifact_repo" && \
21
+ mlflow server \
22
+ --host 0.0.0.0 \
23
+ --port 7860 \
24
+ --backend-store-uri sqlite:///mlflow.db \
25
+ --default-artifact-root ${MLFLOW_HF_ARTIFACT_REPO:-hf://models/omarelrayes/mlflow-artifacts} \
26
+ --serve-artifacts \
27
+ --allowed-hosts "*" \
28
+ --cors-allowed-origins "*"