swanthalok-stack commited on
Commit
3f8befc
·
verified ·
1 Parent(s): 6813194

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -0
Dockerfile ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ # Install system dependencies
4
+ RUN apt-get update && apt-get install -y --no-install-recommends \
5
+ build-essential \
6
+ && rm -rf /var/lib/apt/lists/*
7
+
8
+ WORKDIR /code
9
+
10
+ # Copy requirements and install them securely
11
+ COPY ./backend/requirements.txt /code/requirements.txt
12
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
13
+
14
+ # Copy the rest of your backend folder into the container
15
+ COPY . /code/
16
+
17
+ # Set up paths so the app knows where to look
18
+ ENV PYTHONPATH=/code/backend:/code/backend/app:$PYTHONPATH
19
+
20
+ # Fire up the FastAPI server on Hugging Face's required port
21
+ CMD ["uvicorn", "backend.ml_service:app", "--host", "0.0.0.0", "--port", "7860"]