chane35 commited on
Commit
f24e2c7
·
verified ·
1 Parent(s): 21c24ae

Promote serving Dockerfile to Space root

Browse files
Files changed (1) hide show
  1. Dockerfile +24 -0
Dockerfile ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ ENV PYTHONPATH=/app
4
+ ENV PYTHONDONTWRITEBYTECODE=1
5
+ ENV PYTHONUNBUFFERED=1
6
+
7
+ WORKDIR /app
8
+
9
+ # Install server dependencies
10
+ COPY server/requirements.txt /app/server/requirements.txt
11
+ RUN pip install --no-cache-dir -r /app/server/requirements.txt
12
+
13
+ # Copy the full project
14
+ COPY . /app
15
+
16
+ # Install the permanence package
17
+ RUN pip install --no-cache-dir -e /app
18
+
19
+ EXPOSE 7860
20
+
21
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=15s --retries=3 \
22
+ CMD python -c "import requests; requests.get('http://localhost:7860/health').raise_for_status()" || exit 1
23
+
24
+ CMD ["uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]