Kaveh commited on
Commit
7e78a25
·
unverified ·
1 Parent(s): d242433

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -7
Dockerfile CHANGED
@@ -1,17 +1,23 @@
1
- # استفاده از ایمیج پایه پایتون
2
  FROM python:3.10-slim
3
 
4
- # پوشه کاری در کانتینر
5
  WORKDIR /app
6
 
7
- # کپی کردن فایل requirements
8
- COPY requirements.txt .
 
9
 
10
- # نصب وابستگی‌ها
 
11
  RUN pip install --no-cache-dir -r requirements.txt
12
 
13
- # کپی کردن کل کد پروژه
14
  COPY . .
15
 
16
- # فرمان اجرا (اگر اسکریپت اصلی app.py است)
 
 
 
 
 
 
17
  CMD ["python", "app.py"]
 
 
1
  FROM python:3.10-slim
2
 
 
3
  WORKDIR /app
4
 
5
+ # Create cache directories with proper permissions
6
+ RUN mkdir -p /app/cache /app/nltk_data && \
7
+ chmod 755 /app/cache /app/nltk_data
8
 
9
+ # Copy requirements and install dependencies
10
+ COPY requirements.txt .
11
  RUN pip install --no-cache-dir -r requirements.txt
12
 
13
+ # Copy application code
14
  COPY . .
15
 
16
+ # Set environment variables for cache directories
17
+ ENV TRANSFORMERS_CACHE=/app/cache
18
+ ENV HF_HOME=/app/cache
19
+ ENV NLTK_DATA=/app/nltk_data
20
+
21
+ EXPOSE 7860
22
+
23
  CMD ["python", "app.py"]