farwew commited on
Commit
f79ea86
·
verified ·
1 Parent(s): 4dda8a8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -5
Dockerfile CHANGED
@@ -8,15 +8,18 @@ RUN apt-get update && apt-get install -y \
8
  curl \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
- # Copy requirements first to leverage Docker cache
12
  COPY requirements.txt .
13
  RUN pip install --no-cache-dir -r requirements.txt
14
 
15
- # Copy the rest of the application
16
  COPY . .
17
 
18
- # Change port to 7860 for Hugging Face Spaces
19
  ENV PORT=7860
20
 
21
- # Command to run the application with --reload for development
22
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--reload"]
 
 
 
 
8
  curl \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
+ # Install Python dependencies
12
  COPY requirements.txt .
13
  RUN pip install --no-cache-dir -r requirements.txt
14
 
15
+ # Copy application code
16
  COPY . .
17
 
18
+ # Set environment variable for HF Spaces
19
  ENV PORT=7860
20
 
21
+ # Expose port
22
+ EXPOSE 7860
23
+
24
+ # Run the FastAPI app
25
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]