Skip to content

Commit

Permalink
Merge branch '4/deploy_model_api' of https://github.com/matthieudelsa…
Browse files Browse the repository at this point in the history
…rt/xhec-mlops-project-student into 4/deploy_model_api
  • Loading branch information
matthieudelsart committed Oct 24, 2024
2 parents 835cdee + b012c37 commit b562ef2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
5 changes: 2 additions & 3 deletions Dockerfile.app
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Use Python 3.10 slim version
FROM python:3.10-slim

# - install the app dependencies
# Install the app dependencies
RUN pip install --upgrade pip
COPY requirements.txt ./
RUN pip install -r requirements.txt
Expand All @@ -12,10 +12,9 @@ COPY ./src/web_service /web_service
# Copy the run_services.sh script into the /bin folder
COPY ./bin/run_services.sh /bin/run_services.sh

# Expose the correct ports (8001 for the API, 4201 for Prefect)
# Expose the correct ports (8001 for the API, 4200 for Prefect)
EXPOSE 8001 4200


# Make the run_services.sh script executable
RUN chmod +x /bin/run_services.sh

Expand Down
14 changes: 7 additions & 7 deletions bin/run_services.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/bash
# Set Prefect API URL to be accessible at 0.0.0.0:4200
prefect config set PREFECT_API_URL=http://0.0.0.0:4200/api

sqlite3 --version

# Start Prefect server in the background
prefect server start --host 0.0.0.0 &
prefect server start --host 0.0.0.0 --port 4200 &

# Go in the good directory
cd src/web_service
# Navigate to the correct directory
cd /web_service # Make sure this path is correct

# Start FastAPI with Uvicorn
uvicorn main:app --reload --port 8001
# Start FastAPI with Uvicorn on port 8001
uvicorn main:app --host 0.0.0.0 --port 8001

0 comments on commit b562ef2

Please sign in to comment.