Kalpokoch commited on
Commit
488fca2
·
verified ·
1 Parent(s): 88508ba

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -0
Dockerfile CHANGED
@@ -1,23 +1,33 @@
 
 
 
1
  FROM python:3.11
2
 
 
3
  RUN apt-get update && apt-get install -y \
4
  curl build-essential cmake \
5
  && rm -rf /var/lib/apt/lists/*
6
 
7
  WORKDIR /app
8
 
 
9
  RUN mkdir -p /app/.cache /app/vector_database && chmod -R 777 /app
10
 
 
11
  ENV TRANSFORMERS_CACHE=/app/.cache \
12
  HF_HOME=/app/.cache \
13
  CHROMADB_DISABLE_TELEMETRY=true \
14
  CMAKE_ARGS="-DLLAMA_CUBLAS=OFF"
15
 
 
16
  COPY requirements.txt .
17
  RUN pip install --no-cache-dir -r requirements.txt
18
 
 
19
  COPY . .
20
 
 
21
  EXPOSE 7860
22
 
 
23
  CMD ["uvicorn", "app.app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # FINAL DOCKERFILE
2
+
3
+ # Use the standard Python 3.11 image for maximum compatibility
4
  FROM python:3.11
5
 
6
+ # Install system dependencies needed for compilation
7
  RUN apt-get update && apt-get install -y \
8
  curl build-essential cmake \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
  WORKDIR /app
12
 
13
+ # Create writable directories
14
  RUN mkdir -p /app/.cache /app/vector_database && chmod -R 777 /app
15
 
16
+ # Set env variables
17
  ENV TRANSFORMERS_CACHE=/app/.cache \
18
  HF_HOME=/app/.cache \
19
  CHROMADB_DISABLE_TELEMETRY=true \
20
  CMAKE_ARGS="-DLLAMA_CUBLAS=OFF"
21
 
22
+ # Copy and install Python requirements
23
  COPY requirements.txt .
24
  RUN pip install --no-cache-dir -r requirements.txt
25
 
26
+ # Copy application code
27
  COPY . .
28
 
29
+ # Expose port
30
  EXPOSE 7860
31
 
32
+ # Run FastAPI app
33
  CMD ["uvicorn", "app.app:app", "--host", "0.0.0.0", "--port", "7860"]