artelo1 commited on
Commit
488ed00
verified
1 Parent(s): 3e9ccc0

Upload 2 files

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -11
Dockerfile CHANGED
@@ -1,15 +1,20 @@
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
- # The two following lines are requirements for the Dev Mode to be functional
7
- # Learn more about the Dev Mode at https://huggingface.co/dev-mode-explorers
8
- RUN useradd -m -u 1000 user
9
  WORKDIR /app
10
 
11
- COPY --chown=user ./requirements.txt requirements.txt
12
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
 
 
 
 
 
 
 
 
13
 
14
- COPY --chown=user . /app
15
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
+ # U偶yj oficjalnego obrazu Pythona jako bazy
2
+ FROM python:3.9-slim-buster
3
 
4
+ # Ustaw katalog roboczy wewn膮trz kontenera
 
 
 
 
5
  WORKDIR /app
6
 
7
+ # Skopiuj pliki requirements.txt i zainstaluj zale偶no艣ci
8
+ COPY requirements.txt .
9
+ RUN pip install --no-cache-dir -r requirements.txt
10
+
11
+ # Skopiuj pozosta艂e pliki aplikacji
12
+ COPY . /app
13
+
14
+ # Ustaw zmienn膮 艣rodowiskow膮 PORT, kt贸ra b臋dzie u偶ywana przez FastAPI/Uvicorn
15
+ # Hugging Face Spaces cz臋sto udost臋pnia port 7860 lub 80
16
+ ENV PORT 7860
17
 
18
+ # Uruchom aplikacj臋 Uvicorn, gdy kontener zostanie uruchomiony
19
+ # --host 0.0.0.0 jest kluczowe, aby serwer nas艂uchiwa艂 na wszystkich interfejsach
20
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]