logeswari commited on
Commit
061b971
·
1 Parent(s): 8425d1d
Files changed (1) hide show
  1. Dockerfile +15 -16
Dockerfile CHANGED
@@ -1,22 +1,21 @@
1
- FROM python:3.9
 
2
 
3
- WORKDIR /app
4
- COPY . /app
5
-
6
- ENV HF_HOME=/app/.cache
7
-
8
- RUN mkdir -p /app/.cache/huggingface/hub && \
9
- chmod -R 777 /app/.cache && \
10
- chmod -R 777 /app/.cache/huggingface
11
 
 
 
12
 
 
 
13
 
14
- RUN pip install --upgrade pip
15
- RUN pip install --no-cache-dir -r requirements.txt
16
-
17
- COPY --chown=user ./requirements.txt requirements.txt
18
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
19
 
20
- EXPOSE 7860
 
21
 
22
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
+ # Use an official Python image as a base
2
+ FROM python:3.9-slim
3
 
4
+ # Set environment variables
5
+ ENV PYTHONDONTWRITEBYTECODE=1
6
+ ENV PYTHONUNBUFFERED=1
 
 
 
 
 
7
 
8
+ # Install dependencies
9
+ RUN pip install --no-cache-dir fastapi uvicorn
10
 
11
+ # Create a directory for the app
12
+ WORKDIR /app
13
 
14
+ # Copy your application code
15
+ COPY . /app
 
 
 
16
 
17
+ # Expose the port for the FastAPI app
18
+ EXPOSE 8000
19
 
20
+ # Run the application with Uvicorn
21
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]