Omarelrayes commited on
Commit
ce2d6fa
·
verified ·
1 Parent(s): 93f5c2b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -4
Dockerfile CHANGED
@@ -1,7 +1,7 @@
1
  FROM python:3.10
2
 
3
  # Install dependencies
4
- RUN pip install --no-cache-dir mlflow huggingface_hub psycopg2-binary
5
 
6
  # Expose port
7
  EXPOSE 7860
@@ -11,9 +11,10 @@ ENV HF_TOKEN=${HF_TOKEN}
11
  ENV MLFLOW_HF_ARTIFACT_REPO=${MLFLOW_HF_ARTIFACT_REPO}
12
  ENV DATABASE_URL=${DATABASE_URL}
13
 
14
- # Copy custom artifact repository
15
  WORKDIR /app
16
  COPY hf_artifact_repo.py .
 
17
 
18
- # Start MLflow server (plugin auto-registers on import)
19
- CMD python -c "import hf_artifact_repo" && mlflow server --host 0.0.0.0 --port 7860 --backend-store-uri ${DATABASE_URL} --default-artifact-root ${MLFLOW_HF_ARTIFACT_REPO:-hf://models/omarelrayes/mlflow-artifacts} --serve-artifacts --allowed-hosts "*" --cors-allowed-origins "*"
 
1
  FROM python:3.10
2
 
3
  # Install dependencies
4
+ RUN pip install --no-cache-dir mlflow huggingface_hub psycopg2-binary uvicorn
5
 
6
  # Expose port
7
  EXPOSE 7860
 
11
  ENV MLFLOW_HF_ARTIFACT_REPO=${MLFLOW_HF_ARTIFACT_REPO}
12
  ENV DATABASE_URL=${DATABASE_URL}
13
 
14
+ # Copy files
15
  WORKDIR /app
16
  COPY hf_artifact_repo.py .
17
+ COPY start_mlflow.py .
18
 
19
+ # Start custom MLflow server
20
+ CMD ["python", "start_mlflow.py"]