Peterase commited on
Commit
3bb4dfd
·
1 Parent(s): 2cccea9

fix: update Dockerfile to use port 7860 and app.py entry point for HF Spaces

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -3
Dockerfile CHANGED
@@ -5,6 +5,7 @@ WORKDIR /app
5
  # Install system dependencies
6
  RUN apt-get update && apt-get install -y \
7
  gcc \
 
8
  && rm -rf /var/lib/apt/lists/*
9
 
10
  # Copy requirements
@@ -15,9 +16,17 @@ RUN pip install --no-cache-dir -r requirements.txt
15
 
16
  # Copy application
17
  COPY app/ ./app/
 
18
 
19
- # Expose port
20
- EXPOSE 8000
 
 
 
 
 
 
 
21
 
22
  # Run application
23
- CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
 
5
  # Install system dependencies
6
  RUN apt-get update && apt-get install -y \
7
  gcc \
8
+ curl \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
  # Copy requirements
 
16
 
17
  # Copy application
18
  COPY app/ ./app/
19
+ COPY app.py .
20
 
21
+ # Create necessary directories
22
+ RUN mkdir -p /app/data
23
+
24
+ # Expose Hugging Face Spaces port
25
+ EXPOSE 7860
26
+
27
+ # Health check
28
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
29
+ CMD curl -f http://localhost:7860/health || exit 1
30
 
31
  # Run application
32
+ CMD ["python", "app.py"]