vikramvasudevan commited on
Commit
9538b58
·
verified ·
1 Parent(s): 201637a
Files changed (2) hide show
  1. Dockerfile +11 -6
  2. requirements.txt +0 -0
Dockerfile CHANGED
@@ -1,6 +1,7 @@
 
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,18 +10,22 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
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"]
 
1
+ # Base image: Python 3.11 slim for better compatibility with OpenAI & Pydantic
2
  FROM python:3.11-slim
3
 
4
+ # Install system dependencies needed for building packages
5
  RUN apt-get update && apt-get install -y --no-install-recommends \
6
  build-essential \
7
  libffi-dev \
 
10
  git \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
+ # Create a non-root user
14
  RUN useradd -m -u 1000 user
15
  USER user
16
  ENV PATH="/home/user/.local/bin:$PATH"
17
 
18
+ # Set working directory
19
  WORKDIR /app
20
 
21
+ # Copy and install dependencies
 
 
22
  COPY --chown=user ./requirements.txt requirements.txt
23
+ RUN python -m pip install --upgrade pip \
24
+ && pip install --no-cache-dir -r requirements.txt
25
 
26
+ # Copy app code
27
  COPY --chown=user . /app
28
+
29
+ # Expose port and run Uvicorn
30
+ EXPOSE 7860
31
  CMD ["uvicorn", "api.server:app", "--host", "0.0.0.0", "--port", "7860"]
requirements.txt CHANGED
Binary files a/requirements.txt and b/requirements.txt differ