alaselababatunde commited on
Commit
ea55213
·
1 Parent(s): 410396e
Files changed (1) hide show
  1. smebuilder_vector.py +7 -22
smebuilder_vector.py CHANGED
@@ -1,36 +1,21 @@
1
- # Use lightweight Python image
2
  FROM python:3.10-slim
3
 
4
- # ----------------- SYSTEM DEPENDENCIES -----------------
5
- # Install as root (default user)
6
- RUN apt-get update && apt-get install -y \
7
- build-essential \
8
- git \
9
- curl \
10
- && rm -rf /var/lib/apt/lists/*
11
-
12
- # ----------------- CREATE NON-ROOT USER -----------------
13
- RUN useradd -m appuser
14
-
15
  # Set working directory
16
  WORKDIR /app
17
 
18
- # ----------------- COPY AND INSTALL PYTHON DEPENDENCIES -----------------
19
  COPY requirements.txt .
20
  RUN pip install --no-cache-dir -r requirements.txt
21
 
22
- # ----------------- COPY PROJECT FILES -----------------
23
  COPY . .
24
 
25
- # Make cache folders writable for appuser
26
- RUN mkdir -p /app/huggingface_cache /app/Dev_Assist_SME_Builder_DB \
27
- && chown -R appuser:appuser /app/huggingface_cache /app/Dev_Assist_SME_Builder_DB /app
28
-
29
- # Switch to non-root user
30
- USER appuser
31
 
32
- # Expose FastAPI default port
33
  EXPOSE 7860
34
 
35
- # Command to run FastAPI with Uvicorn
36
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Base image
2
  FROM python:3.10-slim
3
 
 
 
 
 
 
 
 
 
 
 
 
4
  # Set working directory
5
  WORKDIR /app
6
 
7
+ # Copy and install Python dependencies
8
  COPY requirements.txt .
9
  RUN pip install --no-cache-dir -r requirements.txt
10
 
11
+ # Copy project files
12
  COPY . .
13
 
14
+ # Make folders writable for HuggingFace / Chroma
15
+ RUN mkdir -p /app/huggingface_cache /app/Dev_Assist_SME_Builder_DB
 
 
 
 
16
 
17
+ # Expose FastAPI port
18
  EXPOSE 7860
19
 
20
+ # Run as default user
21
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]