File size: 1,128 Bytes
f042c27
4ef3e24
 
 
f042c27
4ef3e24
 
 
 
cbd4ef4
 
3480fd8
 
cbd4ef4
f042c27
 
cbd4ef4
f042c27
 
cbd4ef4
f042c27
 
 
cbd4ef4
f042c27
 
 
 
cbd4ef4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4ef3e24
cbd4ef4
 
 
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
FROM python:3.9-slim

WORKDIR /app

COPY requirements.txt requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

# Set cache directory to /tmp
ENV XDG_CACHE_HOME=/tmp/.cache
ENV MPLCONFIGDIR=/tmp/matplotlib


EXPOSE 7860

# Run with gunicorn
CMD ["gunicorn", "-w", "2", "-b", "0.0.0.0:7860", "app:app"]

# FROM python:3.9-slim

# WORKDIR /app

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

# COPY . .

# EXPOSE 7860

# # Run with gunicorn instead of python
# CMD ["gunicorn", "-w", "2", "-b", "0.0.0.0:7860", "app:app"]

# # # Use a lightweight Python image
# # FROM python:3.10-slim

# # # Set working directory
# # WORKDIR /app

# # # Copy requirements first (for caching layers)
# # COPY requirements.txt .

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

# # # Copy the rest of the code
# # COPY . .

# # # Expose the port Flask/Gunicorn will run on
# # EXPOSE 5000

# # # Run with Gunicorn (production server)
# # #CMD ["python", "app.py"]
# # CMD ["gunicorn", "app:app", "--bind", "0.0.0.0:5000", "--workers", "4"]