muddasser commited on
Commit
0037308
·
verified ·
1 Parent(s): 62b65db

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -15
Dockerfile CHANGED
@@ -1,26 +1,26 @@
1
- # Stage 1 - Build
2
  FROM python:3.10-slim
3
 
4
- # Avoid interactive prompts
5
- ENV DEBIAN_FRONTEND=noninteractive
 
 
 
6
 
7
- # Install dependencies
8
- RUN apt-get update && apt-get install -y \
9
- git wget libgl1 libglib2.0-0 \
10
- && rm -rf /var/lib/apt/lists/*
11
-
12
- # Set work directory
13
  WORKDIR /app
14
 
15
- # Copy requirements and install
16
  COPY requirements.txt .
17
- RUN pip install --no-cache-dir -r requirements.txt
 
 
 
 
 
 
18
 
19
- # Copy app code
20
- COPY app.py .
21
 
22
- # Expose port for Gradio
23
  EXPOSE 7860
24
 
25
- # Run the app
26
  CMD ["python", "app.py"]
 
 
1
  FROM python:3.10-slim
2
 
3
+ # Set env vars for writable config
4
+ ENV MPLCONFIGDIR=/tmp/matplotlib
5
+ ENV YOLO_CONFIG_DIR=/tmp
6
+ ENV HF_HOME=/tmp
7
+ ENV PYTHONUNBUFFERED=1
8
 
 
 
 
 
 
 
9
  WORKDIR /app
10
 
11
+ # Install dependencies
12
  COPY requirements.txt .
13
+ RUN apt-get update && apt-get install -y --no-install-recommends \
14
+ git curl build-essential ffmpeg libsm6 libxext6 \
15
+ && pip install --no-cache-dir -r requirements.txt \
16
+ && apt-get clean && rm -rf /var/lib/apt/lists/*
17
+
18
+ # Copy model weights into container
19
+ COPY anpr_yolov8.pt /app/anpr_yolov8.pt
20
 
21
+ # Copy app files
22
+ COPY app.py /app/app.py
23
 
 
24
  EXPOSE 7860
25
 
 
26
  CMD ["python", "app.py"]