Mohansai2004 commited on
Commit
57eed94
·
1 Parent(s): 23c9421

added the model

Browse files
Files changed (2) hide show
  1. .gitignore +2 -0
  2. Dockerfile +16 -3
.gitignore ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ # Ignore Python cache
2
+ __pycache__/
Dockerfile CHANGED
@@ -1,10 +1,23 @@
1
  FROM python:3.10-slim
2
 
 
3
  WORKDIR /app
4
- COPY . /app
5
 
 
 
 
 
 
 
6
  RUN pip install --no-cache-dir --upgrade pip \
7
  && pip install --no-cache-dir -r requirements.txt
8
 
9
- EXPOSE 7860
10
- CMD ["uvicorn", "app.app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
 
 
 
 
1
  FROM python:3.10-slim
2
 
3
+ # Set working directory
4
  WORKDIR /app
 
5
 
6
+ # Copy only necessary files
7
+ COPY requirements.txt ./
8
+ COPY app/ ./app/
9
+ COPY README.md ./
10
+
11
+ # Install dependencies
12
  RUN pip install --no-cache-dir --upgrade pip \
13
  && pip install --no-cache-dir -r requirements.txt
14
 
15
+ # Expose port for uvicorn
16
+ EXPOSE 8000
17
+
18
+ # Healthcheck for uvicorn
19
+ HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
20
+ CMD curl --fail http://localhost:8000 || exit 1
21
+
22
+ # Start the app
23
+ CMD ["uvicorn", "app.app:app", "--host", "0.0.0.0", "--port", "8000"]