mahdee987 commited on
Commit
1a9bc52
·
verified ·
1 Parent(s): 5671f77

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -5
Dockerfile CHANGED
@@ -1,16 +1,23 @@
1
  FROM python:3.9-slim
2
 
3
- # Create cache directory first with correct permissions
4
- RUN mkdir -p /app/cache && chmod -R 777 /app/cache
 
 
5
 
6
  WORKDIR /app
7
  COPY . .
8
 
9
- # Set environment variables
 
 
 
 
 
 
 
10
  ENV TRANSFORMERS_CACHE=/app/cache \
11
  HF_HOME=/app/cache \
12
  XDG_CACHE_HOME=/app/cache
13
 
14
- RUN pip install --no-cache-dir -r requirements.txt
15
-
16
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM python:3.9-slim
2
 
3
+ # Install system dependencies
4
+ RUN apt-get update && \
5
+ apt-get install -y --no-install-recommends git gcc python3-dev && \
6
+ rm -rf /var/lib/apt/lists/*
7
 
8
  WORKDIR /app
9
  COPY . .
10
 
11
+ # Install Python packages
12
+ RUN pip install --no-cache-dir -r requirements.txt && \
13
+ pip install --no-cache-dir torch==2.0.1 --index-url https://download.pytorch.org/whl/cu118
14
+
15
+ # Create cache directories
16
+ RUN mkdir -p /app/cache /app/finetuned /app/logs && \
17
+ chmod -R 777 /app/cache /app/finetuned /app/logs
18
+
19
  ENV TRANSFORMERS_CACHE=/app/cache \
20
  HF_HOME=/app/cache \
21
  XDG_CACHE_HOME=/app/cache
22
 
 
 
23
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]