File size: 864 Bytes
b819585
 
b0f82e3
 
 
 
 
 
03c6e78
b0f82e3
 
03c6e78
b0f82e3
 
03c6e78
b0f82e3
 
b819585
 
03c6e78
b0f82e3
 
 
b819585
b0f82e3
b819585
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Dockerfile (نسخه نهایی و بهینه شده)

# Use an official Python runtime as a parent image
FROM python:3.9-slim

# Set the working directory in the container
WORKDIR /app

# Copy requirements first for better caching
COPY requirements.txt .

# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Copy the rest of the application's code
COPY . .

# <<< تغییر کلیدی: یک پوشه قابل نوشتن و مجزا برای فایل‌های موقت ایجاد می‌کنیم >>>
RUN mkdir -p /app/tmp && chmod 777 /app/tmp

# Expose the port the app runs on
EXPOSE 7860

# <<< تغییر کلیدی: بهینه سازی برای پردازش همزمان کاربران بیشتر >>>
# Run app.py when the container launches
CMD ["gunicorn", "--workers", "2", "--threads", "4", "--bind", "0.0.0.0:7860", "app:app"]