Redfire-1234 commited on
Commit
9a99896
·
verified ·
1 Parent(s): 7088783

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -9
Dockerfile CHANGED
@@ -6,29 +6,26 @@ WORKDIR /app
6
  # Install system dependencies
7
  RUN apt-get update && apt-get install -y \
8
  build-essential \
9
- curl \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
  # Copy requirements first (for layer caching)
13
  COPY requirements.txt .
14
 
15
  # Install Python dependencies
16
- RUN pip install --no-cache-dir --upgrade pip && \
17
- pip install --no-cache-dir -r requirements.txt
18
 
19
  # Copy application code
20
  COPY . .
21
 
22
- # Create necessary directories with proper permissions
23
- RUN mkdir -p data/vector_store && \
24
- chmod -R 777 data
25
 
26
- # Expose port 7860 (Hugging Face Spaces requirement)
27
  EXPOSE 7860
28
 
29
  # Health check
30
  HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
31
- CMD curl -f http://localhost:7860/ || exit 1
32
 
33
  # Run the application on port 7860
34
- CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]
 
6
  # Install system dependencies
7
  RUN apt-get update && apt-get install -y \
8
  build-essential \
 
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
  # Copy requirements first (for layer caching)
12
  COPY requirements.txt .
13
 
14
  # Install Python dependencies
15
+ RUN pip install --no-cache-dir -r requirements.txt
 
16
 
17
  # Copy application code
18
  COPY . .
19
 
20
+ # Create necessary directories
21
+ RUN mkdir -p data/vector_store
 
22
 
23
+ # Expose port 7860 (Hugging Face Spaces default)
24
  EXPOSE 7860
25
 
26
  # Health check
27
  HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
28
+ CMD python -c "import requests; requests.get('http://localhost:7860/api/status')"
29
 
30
  # Run the application on port 7860
31
+ CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]