factorstudios commited on
Commit
f4322c1
·
verified ·
1 Parent(s): d14872c

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +28 -0
Dockerfile ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.12-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # Install system dependencies
6
+ RUN apt-get update && apt-get install -y \
7
+ curl \
8
+ && rm -rf /var/lib/apt/lists/*
9
+
10
+ # Copy requirements first for better caching
11
+ COPY requirements.txt .
12
+
13
+ # Install Python dependencies
14
+ RUN pip install --no-cache-dir -r requirements.txt
15
+
16
+ # Copy application code
17
+ # Note: .env is mounted via docker-compose volume
18
+ COPY server.py .
19
+
20
+ # Health check
21
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
22
+ CMD curl -f http://localhost:7861/ || exit 1
23
+
24
+ # Expose port 7861
25
+ EXPOSE 7861
26
+
27
+ # Run the server
28
+ CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7861"]