sixfingerdev commited on
Commit
7c95aa3
·
verified ·
1 Parent(s): d7fff3d

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +32 -0
Dockerfile ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Hugging Face Spaces - Sixfinger Backend API Dockerfile
2
+
3
+ FROM python:3.11-slim
4
+
5
+ # Working directory
6
+ WORKDIR /app
7
+
8
+ # System dependencies
9
+ RUN apt-get update && apt-get install -y \
10
+ curl \
11
+ && rm -rf /var/lib/apt/lists/*
12
+
13
+ # Python dependencies
14
+ COPY requirements.txt .
15
+ RUN pip install --no-cache-dir --upgrade pip && \
16
+ pip install --no-cache-dir -r requirements.txt
17
+
18
+ # Copy application
19
+ COPY main.py .
20
+
21
+ # Hugging Face Spaces PORT
22
+ ENV PORT=7860
23
+
24
+ # Health check
25
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
26
+ CMD curl -f http://localhost:7860/health || exit 1
27
+
28
+ # Expose port
29
+ EXPOSE 7860
30
+
31
+ # Run application
32
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]