prelington commited on
Commit
123e764
·
verified ·
1 Parent(s): c03f547

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +23 -0
Dockerfile ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # Install dependencies
6
+ COPY requirements.txt .
7
+ RUN pip install --no-cache-dir -r requirements.txt
8
+
9
+ # Copy model and code
10
+ COPY . .
11
+
12
+ # Create non-root user
13
+ RUN useradd -m -u 1000 modeluser
14
+ USER modeluser
15
+
16
+ # Expose port
17
+ EXPOSE 8000
18
+
19
+ # Health check
20
+ HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
21
+ CMD curl -f http://localhost:8000/health || exit 1
22
+
23
+ CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "8000"]