fahmiaziz98 commited on
Commit
fac5663
·
1 Parent(s): e47fe2d
Files changed (2) hide show
  1. Dockerfile +4 -25
  2. requirements.txt +3 -3
Dockerfile CHANGED
@@ -1,37 +1,16 @@
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.10-slim
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 ["python", "app.py"]
17
-
18
- # Gunakan base image ringan tapi sudah mendukung PyTorch + Transformers
19
- FROM huggingface/transformers-pytorch-cpu:latest
20
-
21
- # Buat user non-root (wajib di Spaces)
22
  RUN useradd -m -u 1000 user
23
  USER user
24
  ENV PATH="/home/user/.local/bin:$PATH"
25
 
26
  WORKDIR /app
27
 
28
- # Copy file requirements dan install dependency
29
  COPY --chown=user ./requirements.txt requirements.txt
30
- RUN pip install --no-cache-dir --upgrade pip \
31
- && pip install --no-cache-dir -r requirements.txt --break-system-packages
32
 
33
- # Copy seluruh source code
34
  COPY --chown=user . /app
35
-
36
- # Jalankan aplikasi
37
  CMD ["python", "app.py"]
 
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.10-slim
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 ["python", "app.py"]
requirements.txt CHANGED
@@ -1,9 +1,9 @@
1
  fastapi[standard]==0.116.2
2
  uvicorn==0.35.0
3
- torch==2.5.1+cpu
4
- sentence-transformers==2.2.2
5
  loguru==0.7.3
6
  einops==0.8.1
7
  pydantic-settings==2.11.0
8
  pyyaml==6.0.3
9
- pinecone==7.3.0
 
1
  fastapi[standard]==0.116.2
2
  uvicorn==0.35.0
3
+ torch==2.8.0
4
+ sentence-transformers==5.1.1
5
  loguru==0.7.3
6
  einops==0.8.1
7
  pydantic-settings==2.11.0
8
  pyyaml==6.0.3
9
+ pinecone==7.3.0