service-internal commited on
Commit
1e1cbba
·
verified ·
1 Parent(s): c318e72

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -16
Dockerfile CHANGED
@@ -1,20 +1,13 @@
 
1
  FROM python:3.10-slim
2
-
3
- # Set environment variables
4
- ENV PYTHONDONTWRITEBYTECODE=1
5
- ENV PYTHONUNBUFFERED=1
6
-
7
- # Install dependencies
8
- RUN apt-get update && apt-get install -y git && apt-get clean
9
-
10
  # Set working directory
11
- WORKDIR /app
12
-
13
- # Copy files
14
  COPY requirements.txt .
15
- RUN pip install --upgrade pip && pip install -r requirements.txt
16
-
17
  COPY main.py .
18
-
19
- # Run the app
20
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
 
 
1
+ # Use an official Python base image
2
  FROM python:3.10-slim
 
 
 
 
 
 
 
 
3
  # Set working directory
4
+ WORKDIR /code
5
+ # Install dependencies
 
6
  COPY requirements.txt .
7
+ RUN pip install --no-cache-dir -r requirements.txt
8
+ # Copy app files
9
  COPY main.py .
10
+ # Expose port for Hugging Face Spaces
11
+ EXPOSE 7860
12
+ # Start the FastAPI app using uvicorn
13
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]