Deadman922 commited on
Commit
8279643
·
verified ·
1 Parent(s): d2da2ca

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +27 -0
Dockerfile ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # Environment configuration
6
+ ENV ENABLE_WEB_INTERFACE=true
7
+ ENV PYTHONPATH=/app
8
+
9
+ # Install uv
10
+ RUN pip install --no-cache-dir uv
11
+
12
+ # Copy dependencies first (cache layer)
13
+ COPY requirements.txt .
14
+ RUN uv pip install --system --no-cache -r requirements.txt
15
+
16
+ # Copy application code
17
+ COPY . .
18
+
19
+ # Expose the port
20
+ EXPOSE 7860
21
+
22
+ # Health check
23
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
24
+ CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:7860/health')" || exit 1
25
+
26
+ # Start the server
27
+ CMD ["python", "-m", "uvicorn", "server.main:app", "--host", "0.0.0.0", "--port", "7860"]