samim2024 commited on
Commit
6c3a044
·
verified ·
1 Parent(s): 89e951d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -11
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- # Use official slim Python base image
2
  FROM python:3.10-slim
3
 
4
  # Environment settings
@@ -7,18 +7,14 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
7
  TRANSFORMERS_CACHE=/tmp/huggingface \
8
  HF_HOME=/tmp/huggingface
9
 
10
- # Create cache and working directories
11
  RUN mkdir -p /tmp/huggingface /app/data /app/vectorstore
12
  WORKDIR /app
13
 
14
  # Install OS dependencies
15
  RUN apt-get update && apt-get install -y --no-install-recommends \
16
  build-essential \
17
- libglib2.0-0 \
18
- libsm6 \
19
- libxext6 \
20
- libxrender-dev \
21
- && rm -rf /var/lib/apt/lists/*
22
 
23
  # Install Python dependencies
24
  COPY requirements.txt .
@@ -27,8 +23,8 @@ RUN pip install --no-cache-dir --upgrade pip && pip install --no-cache-dir -r re
27
  # Copy application code
28
  COPY . .
29
 
30
- # Expose ports for Streamlit and FastAPI
31
- EXPOSE 8501 8000
32
 
33
- # Run both Streamlit and FastAPI
34
- CMD ["sh", "-c", "streamlit run app.py & exec uvicorn api:app --host 0.0.0.0 --port 8000"]
 
1
+ # Use slim Python base image
2
  FROM python:3.10-slim
3
 
4
  # Environment settings
 
7
  TRANSFORMERS_CACHE=/tmp/huggingface \
8
  HF_HOME=/tmp/huggingface
9
 
10
+ # Create directories
11
  RUN mkdir -p /tmp/huggingface /app/data /app/vectorstore
12
  WORKDIR /app
13
 
14
  # Install OS dependencies
15
  RUN apt-get update && apt-get install -y --no-install-recommends \
16
  build-essential \
17
+ && rm -rf /var/lib/apt/lists/*
 
 
 
 
18
 
19
  # Install Python dependencies
20
  COPY requirements.txt .
 
23
  # Copy application code
24
  COPY . .
25
 
26
+ # Expose Streamlit port
27
+ EXPOSE 8501
28
 
29
+ # Run Streamlit with FastAPI proxy
30
+ CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]