ztoolx commited on
Commit
23034ea
·
verified ·
1 Parent(s): 684eb72

up docker

Browse files
Files changed (1) hide show
  1. Dockerfile +3 -5
Dockerfile CHANGED
@@ -2,21 +2,19 @@ FROM python:3.9-slim
2
 
3
  WORKDIR /app
4
 
5
- # Install system dependencies (Fixed: removed software-properties-common)
6
  RUN apt-get update && apt-get install -y \
7
  build-essential \
8
  curl \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
- # Install Python dependencies
12
  COPY requirements.txt .
13
  RUN pip install --no-cache-dir -r requirements.txt
14
 
15
- # Copy application code
16
  COPY . .
17
 
18
- # Expose port (HF Spaces expects 7860 by default)
19
  EXPOSE 7860
20
 
21
- # Run the application
 
 
22
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
2
 
3
  WORKDIR /app
4
 
 
5
  RUN apt-get update && apt-get install -y \
6
  build-essential \
7
  curl \
8
  && rm -rf /var/lib/apt/lists/*
9
 
 
10
  COPY requirements.txt .
11
  RUN pip install --no-cache-dir -r requirements.txt
12
 
 
13
  COPY . .
14
 
 
15
  EXPOSE 7860
16
 
17
+ # Add a health check to keep the space alive
18
+ HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 CMD curl --fail http://localhost:7860/health || exit 1
19
+
20
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]