Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- 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
|
| 10 |
ENV HF_TOKEN=${HF_TOKEN}
|
| 11 |
ENV MLFLOW_HF_ARTIFACT_REPO=${MLFLOW_HF_ARTIFACT_REPO}
|
|
|
|
| 12 |
|
| 13 |
-
#
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 "*"
|