ehsanhon commited on
Commit
59d2d71
·
verified ·
1 Parent(s): c031f41

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +37 -1
Dockerfile CHANGED
@@ -1,10 +1,46 @@
1
  FROM python:3.10-slim
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  WORKDIR /app
4
- COPY . /app
5
 
 
 
6
  RUN pip install --no-cache-dir -r requirements.txt
7
 
 
 
 
 
8
  EXPOSE 7860
9
 
 
10
  CMD ["python", "app.py"]
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  FROM python:3.10-slim
2
 
3
+ # Install necessary system packages
4
+ RUN apt-get update && apt-get install -y \
5
+ libgl1 \
6
+ libglib2.0-0 \
7
+ wget \
8
+ unzip \
9
+ && rm -rf /var/lib/apt/lists/*
10
+
11
+ # Optional: install ngrok if using flask-ngrok
12
+ RUN wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip && \
13
+ unzip ngrok-stable-linux-amd64.zip -d /usr/local/bin && \
14
+ chmod +x /usr/local/bin/ngrok && \
15
+ rm ngrok-stable-linux-amd64.zip
16
+
17
+ # Fix for matplotlib permission issue
18
+ ENV MPLCONFIGDIR=/tmp/matplotlib
19
+
20
+ # Set working directory
21
  WORKDIR /app
 
22
 
23
+ # Install Python dependencies
24
+ COPY requirements.txt requirements.txt
25
  RUN pip install --no-cache-dir -r requirements.txt
26
 
27
+ # Copy app code
28
+ COPY . .
29
+
30
+ # Expose the Flask port
31
  EXPOSE 7860
32
 
33
+ # Run the app
34
  CMD ["python", "app.py"]
35
+
36
+
37
+ # FROM python:3.10-slim
38
+
39
+ # WORKDIR /app
40
+ # COPY . /app
41
+
42
+ # RUN pip install --no-cache-dir -r requirements.txt
43
+
44
+ # EXPOSE 7860
45
+
46
+ # CMD ["python", "app.py"]