Soumik555 commited on
Commit
d47a8de
·
1 Parent(s): 8690a80

payment page

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -2
Dockerfile CHANGED
@@ -1,6 +1,11 @@
1
  # Use the official Python 3.11 slim image
2
  FROM python:3.11-slim
3
 
 
 
 
 
 
4
  # Set the working directory inside the container
5
  WORKDIR /app
6
 
@@ -37,5 +42,5 @@ RUN chown -R 1000:1000 /app && \
37
  # Expose port 7860 (required by Hugging Face Spaces)
38
  EXPOSE 7860
39
 
40
- # Command to start FastAPI using Uvicorn
41
- CMD ["uvicorn", "controller:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  # Use the official Python 3.11 slim image
2
  FROM python:3.11-slim
3
 
4
+ # Install curl for keep-alive script and clean up
5
+ RUN apt-get update && \
6
+ apt-get install -y curl && \
7
+ rm -rf /var/lib/apt/lists/*
8
+
9
  # Set the working directory inside the container
10
  WORKDIR /app
11
 
 
42
  # Expose port 7860 (required by Hugging Face Spaces)
43
  EXPOSE 7860
44
 
45
+ # Keep-alive command (pings every 5 minutes) + start Uvicorn
46
+ CMD bash -c "while true; do curl -s http://localhost:7860/ping >/dev/null && sleep 300; done & uvicorn controller:app --host 0.0.0.0 --port 7860"