SammyG123 commited on
Commit
2f780ee
·
1 Parent(s): 8ecfe5a

updated dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -12
Dockerfile CHANGED
@@ -1,21 +1,15 @@
1
  FROM python:3.10-slim
2
 
3
- # Install system dependencies
4
- RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
5
 
6
- # Set work directory
7
- WORKDIR /app
8
 
9
- # Copy requirements if present, otherwise install transformers and torch
10
- COPY requirements.txt ./
11
- RUN pip install --no-cache-dir --upgrade pip \
12
- && if [ -f requirements.txt ]; then pip install --no-cache-dir -r requirements.txt; else pip install --no-cache-dir transformers torch; fi
13
 
14
- # Copy the rest of the code
15
  COPY . .
16
 
17
- # Expose port (change if your app uses a different port)
18
  EXPOSE 7860
19
 
20
- # Default command (change app.py to your entrypoint if needed)
21
- CMD ["python", "app.py"]
 
1
  FROM python:3.10-slim
2
 
3
+ ENV PYTHONUNBUFFERED=1 \
4
+ PORT=7860
5
 
6
+ WORKDIR /code
 
7
 
8
+ COPY requirements.txt .
9
+ RUN pip install --no-cache-dir -r requirements.txt
 
 
10
 
 
11
  COPY . .
12
 
 
13
  EXPOSE 7860
14
 
15
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]