Sp2503 commited on
Commit
9052cef
·
verified ·
1 Parent(s): e0eaa41

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -1
Dockerfile CHANGED
@@ -1,11 +1,28 @@
 
1
  FROM python:3.10-slim
 
 
2
  ENV TORCH_DISABLE_CUDA=1
3
  ENV HF_HOME=/app/hf_cache
4
  ENV TRANSFORMERS_CACHE=/app/hf_cache
 
 
5
  WORKDIR /app
 
 
6
  COPY requirements.txt .
7
- RUN apt-get update && apt-get install -y git && pip install --no-cache-dir -r requirements.txt && rm -rf /var/lib/apt/lists/*
 
 
 
 
8
  COPY . .
 
 
9
  RUN mkdir -p /app/hf_cache && chmod -R 777 /app/hf_cache
 
 
10
  EXPOSE 8080
 
 
11
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8080"]
 
1
+ # Lightweight Python image
2
  FROM python:3.10-slim
3
+
4
+ # Disable CUDA & set cache
5
  ENV TORCH_DISABLE_CUDA=1
6
  ENV HF_HOME=/app/hf_cache
7
  ENV TRANSFORMERS_CACHE=/app/hf_cache
8
+
9
+ # Working directory
10
  WORKDIR /app
11
+
12
+ # Install dependencies
13
  COPY requirements.txt .
14
+ RUN apt-get update && apt-get install -y git && \
15
+ pip install --no-cache-dir -r requirements.txt && \
16
+ rm -rf /var/lib/apt/lists/*
17
+
18
+ # Copy app code and model/data
19
  COPY . .
20
+
21
+ # Make cache folder writable
22
  RUN mkdir -p /app/hf_cache && chmod -R 777 /app/hf_cache
23
+
24
+ # Expose port
25
  EXPOSE 8080
26
+
27
+ # Run FastAPI via uvicorn
28
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8080"]