factorstudios commited on
Commit
0fdaac3
·
verified ·
1 Parent(s): cb2ab9a

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +33 -0
Dockerfile ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ ffmpeg \
8
+ libsm6 \
9
+ libxext6 \
10
+ libxrender-dev \
11
+ libfreetype6 \
12
+ curl \
13
+ && rm -rf /var/lib/apt/lists/*
14
+
15
+ # Copy requirements first for better caching
16
+ COPY requirements.txt .
17
+
18
+ # Install Python dependencies
19
+ RUN pip install --no-cache-dir -r requirements.txt
20
+
21
+ # Copy application code
22
+ # Note: .env is mounted via docker-compose volume
23
+ COPY server.py .
24
+
25
+ # Health check
26
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
27
+ CMD curl -f http://localhost:7862/ || exit 1
28
+
29
+ # Expose port 7862
30
+ EXPOSE 7860
31
+
32
+ # Run the server
33
+ CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]