rabindra-sss commited on
Commit
65e6409
·
verified ·
1 Parent(s): 28d8ed8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -8
Dockerfile CHANGED
@@ -1,18 +1,20 @@
1
- # Use an official lightweight Python image
2
- FROM python:3.12
3
 
4
  # Set working directory
5
  WORKDIR /app
6
 
7
- # Copy the requirements file and install dependencies
8
- COPY requirements.txt .
 
 
9
  RUN pip install -r requirements.txt
10
 
11
- # Copy the FastAPI and model files
12
- COPY main.py backend.py ./
 
13
 
14
- # Expose the port for FastAPI
15
  EXPOSE 8000
16
 
17
- # Run the FastAPI server using Uvicorn
18
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
 
1
+ FROM python:3.12-slim
 
2
 
3
  # Set working directory
4
  WORKDIR /app
5
 
6
+ # Copy your application code
7
+ COPY . .
8
+
9
+ # Install dependencies
10
  RUN pip install -r requirements.txt
11
 
12
+ # Create and set the cache directory for Hugging Face
13
+ ENV TRANSFORMERS_CACHE=/app/cache
14
+ RUN mkdir -p /app/cache && chmod -R 777 /app/cache
15
 
16
+ # Expose the port
17
  EXPOSE 8000
18
 
19
+ # Run the application
20
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]