MaroofTechSorcerer commited on
Commit
808f1b3
·
verified ·
1 Parent(s): 83a42a7

Update Dockerfifle

Browse files
Files changed (1) hide show
  1. Dockerfifle +9 -5
Dockerfifle CHANGED
@@ -1,20 +1,24 @@
1
  FROM python:3.10-slim
2
 
 
 
 
 
3
  # Install system dependencies from apt.txt
4
  COPY apt.txt .
5
  RUN apt-get update && \
6
  xargs -a apt.txt apt-get install -y && \
7
  rm -rf /var/lib/apt/lists/*
8
 
 
 
 
9
  # Set working directory
10
  WORKDIR /app
11
 
12
- # Pre-install large packages to reduce memory pressure
13
- RUN pip install --no-cache-dir torch==2.0.0 torchaudio==2.0.1
14
-
15
- # Copy requirements and install with force-reinstall
16
  COPY requirements.txt .
17
- RUN pip install --no-cache-dir --force-reinstall -r requirements.txt
18
 
19
  # Copy app code
20
  COPY app.py .
 
1
  FROM python:3.10-slim
2
 
3
+ # Set environment variables to reduce pip caching and ensure consistent builds
4
+ ENV PIP_NO_CACHE_DIR=1
5
+ ENV PYTHONUNBUFFERED=1
6
+
7
  # Install system dependencies from apt.txt
8
  COPY apt.txt .
9
  RUN apt-get update && \
10
  xargs -a apt.txt apt-get install -y && \
11
  rm -rf /var/lib/apt/lists/*
12
 
13
+ # Upgrade pip to avoid dependency resolution issues
14
+ RUN pip install --upgrade pip
15
+
16
  # Set working directory
17
  WORKDIR /app
18
 
19
+ # Copy requirements and install
 
 
 
20
  COPY requirements.txt .
21
+ RUN pip install -r requirements.txt
22
 
23
  # Copy app code
24
  COPY app.py .