vikramvasudevan commited on
Commit
201637a
·
verified ·
1 Parent(s): 538bbe5
Files changed (1) hide show
  1. Dockerfile +6 -3
Dockerfile CHANGED
@@ -1,6 +1,6 @@
1
  FROM python:3.11-slim
2
 
3
- # Install system dependencies
4
  RUN apt-get update && apt-get install -y --no-install-recommends \
5
  build-essential \
6
  libffi-dev \
@@ -9,15 +9,18 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
9
  git \
10
  && rm -rf /var/lib/apt/lists/*
11
 
 
12
  RUN useradd -m -u 1000 user
13
  USER user
14
  ENV PATH="/home/user/.local/bin:$PATH"
15
 
16
  WORKDIR /app
17
 
 
 
 
18
  COPY --chown=user ./requirements.txt requirements.txt
19
- RUN pip install --no-cache-dir --upgrade pip \
20
- && pip install --no-cache-dir -r requirements.txt
21
 
22
  COPY --chown=user . /app
23
  CMD ["uvicorn", "api.server:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM python:3.11-slim
2
 
3
+ # Install system dependencies for building wheels
4
  RUN apt-get update && apt-get install -y --no-install-recommends \
5
  build-essential \
6
  libffi-dev \
 
9
  git \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
+ # Create non-root user
13
  RUN useradd -m -u 1000 user
14
  USER user
15
  ENV PATH="/home/user/.local/bin:$PATH"
16
 
17
  WORKDIR /app
18
 
19
+ # Upgrade pip first
20
+ RUN pip install --upgrade pip
21
+
22
  COPY --chown=user ./requirements.txt requirements.txt
23
+ RUN pip install --no-cache-dir -r requirements.txt
 
24
 
25
  COPY --chown=user . /app
26
  CMD ["uvicorn", "api.server:app", "--host", "0.0.0.0", "--port", "7860"]