Deep8591 commited on
Commit
92f6026
·
verified ·
1 Parent(s): c9a3348

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -12
Dockerfile CHANGED
@@ -1,23 +1,20 @@
1
- # Use official Python 3.10 base image
2
  FROM python:3.10
3
 
4
- # Set the working directory in the container
5
  WORKDIR /app
6
 
7
- # Copy the requirements file into the container
8
  COPY requirements.txt .
9
-
10
- # Install dependencies without using cache to reduce image size
11
  RUN pip install --no-cache-dir -r requirements.txt
12
 
13
- # Ensure a writable cache directory for Hugging Face models
14
- ENV TRANSFORMERS_CACHE="/app/models_cache"
15
-
16
- # Copy the application code into the container
17
  COPY . .
18
 
19
- # Expose the application port
 
 
 
20
  EXPOSE 7860
21
 
22
- # Command to run the FastAPI application with Uvicorn
23
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]
 
 
1
  FROM python:3.10
2
 
3
+ # Set the working directory
4
  WORKDIR /app
5
 
6
+ # Copy and install dependencies
7
  COPY requirements.txt .
 
 
8
  RUN pip install --no-cache-dir -r requirements.txt
9
 
10
+ # Copy the application code
 
 
 
11
  COPY . .
12
 
13
+ # Ensure the models_cache directory exists and set permissions
14
+ RUN mkdir -p /app/models_cache && chmod -R 777 /app/models_cache
15
+
16
+ # Expose port 7860
17
  EXPOSE 7860
18
 
19
+ # Run the FastAPI application with Uvicorn
20
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]