ehsanhon commited on
Commit
4423df5
·
verified ·
1 Parent(s): 390631e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -11
Dockerfile CHANGED
@@ -1,26 +1,27 @@
1
- # Use a lightweight Python 3.10 image
2
  FROM python:3.10-slim
3
 
4
- # Install system-level dependencies required by OpenCV
5
  RUN apt-get update && apt-get install -y \
6
  libgl1 \
7
  libglib2.0-0 \
 
 
8
  && rm -rf /var/lib/apt/lists/*
9
 
10
- # Set the working directory
11
- WORKDIR /app
 
 
 
12
 
13
- # Copy dependency list first (for Docker caching)
14
- COPY requirements.txt requirements.txt
15
 
16
- # Install Python dependencies
 
17
  RUN pip install --no-cache-dir -r requirements.txt
18
-
19
- # Copy the rest of the app files
20
  COPY . .
21
 
22
- # Expose the port your Flask app runs on
23
  EXPOSE 7860
24
 
25
- # Run the app
26
  CMD ["python", "app.py"]
 
 
1
  FROM python:3.10-slim
2
 
3
+ # System dependencies
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
+ # Install ngrok manually and set permission
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
+ # Set matplotlib config dir to avoid permission issues
18
+ ENV MPLCONFIGDIR=/tmp/matplotlib
19
 
20
+ WORKDIR /app
21
+ COPY requirements.txt requirements.txt
22
  RUN pip install --no-cache-dir -r requirements.txt
 
 
23
  COPY . .
24
 
 
25
  EXPOSE 7860
26
 
 
27
  CMD ["python", "app.py"]