Open K0nkere opened 2 years ago
The folowing Dockerfile has to be located in /project/3-deployment along with Pipfile Pipfile.lock predict.py
FROM python:3.9.7-slim
RUN pip install -U pip
RUN pip install pipenv
WORKDIR /app
COPY ["Pipfile", "Pipfile.lock", "./"]
ENV MLFLOW_S3_ENDPOINT_URL=https://storage.yandexcloud.net
ENV AWS_DEFAULT_REGION=ru-central1
ENV AWS_ACCESS_KEY_ID=<your_aws_key_id>
ENV AWS_SECRET_ACCESS_KEY=<your_aws_key>
ENV PUBLIC_SERVER_IP=51.250.101.205
RUN pipenv install --system --deploy
COPY ["predict.py", "./"]
EXPOSE 5000
EXPOSE 9696
ENTRYPOINT ["gunicorn", "--bind=0.0.0.0:9696", "predict:app"]
Flask entrypoint should be in format
docker build -t mlops-project-prediction-service:v1 ./3-deployment/ docker run -it --rm -p 9696:9696 mlops-project-prediction-service:v1
mlflow ui --backend-store-uri sqlite:///../mlops-project.db --default-artifact-root s3://kkr-mlops-zoomcamp/mlflow-artifacts/
mlflow server --backend-store-uri sqlite:///../mlops-project.db --default-artifact-root s3://kkr-mlops-zoomcamp/mlflow-artifacts/ --host 0.0.0.0
Creating of virtual environment with pipenv
pipenv install --python=3.9
requirements.txt
pipenv shell
Maybe its need to run if Pipfile is empty
pipenv install -r requirements.txt