bteodoru commited on
Commit
a36f6a8
·
verified ·
1 Parent(s): ce56680

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +19 -10
Dockerfile CHANGED
@@ -1,16 +1,25 @@
1
- # Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
- # you will also find guides on how best to write your Dockerfile
3
 
4
- FROM python:3.9
5
 
6
- RUN useradd -m -u 1000 user
7
- USER user
8
- ENV PATH="/home/user/.local/bin:$PATH"
 
9
 
10
- WORKDIR /app
 
 
 
11
 
12
- COPY --chown=user ./requirements.txt requirements.txt
13
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
14
 
15
- COPY --chown=user . /app
 
 
 
 
 
 
16
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ FROM python:3.9-slim
 
2
 
3
+ WORKDIR /code
4
 
5
+ # Instalăm dependențele sistemului necesare pentru numpy și pandas
6
+ RUN apt-get update && apt-get install -y \
7
+ build-essential \
8
+ && rm -rf /var/lib/apt/lists/*
9
 
10
+ # Copiem fișierele necesare
11
+ COPY ./requirements.txt /code/requirements.txt
12
+ COPY ./model.joblib /code/model.joblib
13
+ COPY ./app.py /code/app.py
14
 
15
+ # Instalăm mai întâi numpy pentru a ne asigura că avem versiunea corectă
16
+ RUN pip install --no-cache-dir numpy==1.23.5
17
 
18
+ # Apoi instalăm restul dependențelor
19
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
20
+
21
+ # Expunem portul standard pentru Hugging Face Spaces
22
+ EXPOSE 7860
23
+
24
+ # Pornim serverul FastAPI
25
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]