t3k45h1 commited on
Commit
9e9116b
·
verified ·
1 Parent(s): f580797

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -10
Dockerfile CHANGED
@@ -1,24 +1,29 @@
1
- # Use lightweight Python base
2
  FROM python:3.10-slim
3
 
4
- # Set working directory
5
  WORKDIR /app
6
 
7
- # Install git and any system dependencies
8
  RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
9
 
10
- # Copy and install Python dependencies
11
  COPY requirements.txt .
12
  RUN pip install --no-cache-dir -r requirements.txt
13
 
14
- # Copy your app code
15
  COPY . .
16
 
17
- # Expose the port FastAPI will run on
18
- EXPOSE 7860
19
-
20
- # Create cache folder with write permissions
21
  RUN mkdir -p /app/cache
22
 
23
- # Run FastAPI app via uvicorn
 
 
 
 
 
 
 
 
 
24
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Dockerfile for PromptAgro
2
  FROM python:3.10-slim
3
 
 
4
  WORKDIR /app
5
 
6
+ # Install system dependencies
7
  RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
8
 
9
+ # Install Python dependencies
10
  COPY requirements.txt .
11
  RUN pip install --no-cache-dir -r requirements.txt
12
 
13
+ # Copy app code
14
  COPY . .
15
 
16
+ # Pre-create cache directory (optional)
 
 
 
17
  RUN mkdir -p /app/cache
18
 
19
+ # Set up cache directories and environment variables
20
+ RUN mkdir -p /tmp/huggingface_cache
21
+ ENV HF_HOME=/tmp/huggingface_cache
22
+ ENV TRANSFORMERS_CACHE=/tmp/huggingface_cache
23
+ ENV HF_HUB_CACHE=/tmp/huggingface_cache
24
+
25
+ # Expose port
26
+ EXPOSE 7860
27
+
28
+ # Start FastAPI app
29
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]