ganeshkonapalli commited on
Commit
db1821b
·
verified ·
1 Parent(s): fe72b98

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -7
Dockerfile CHANGED
@@ -1,28 +1,28 @@
1
  # Use official Python slim image
2
  FROM python:3.10-slim
3
 
4
- # Set environment variables
5
  ENV PYTHONDONTWRITEBYTECODE 1
6
  ENV PYTHONUNBUFFERED 1
7
 
8
- # Set working directory
9
  WORKDIR /code
10
 
11
- # Install OS dependencies (none needed for Logistic Regression, optional: git, curl, etc.)
12
  RUN apt-get update && \
13
  apt-get install -y --no-install-recommends \
14
  build-essential && \
15
  rm -rf /var/lib/apt/lists/*
16
 
17
- # Copy requirements and install Python packages
18
  COPY requirements.txt .
19
  RUN pip install --upgrade pip && pip install -r requirements.txt
20
 
21
- # Copy application files
22
  COPY . .
23
 
24
- # Expose port (for HF Spaces or local dev)
25
  EXPOSE 7860
26
 
27
- # Run FastAPI app
28
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  # Use official Python slim image
2
  FROM python:3.10-slim
3
 
4
+ # Environment variables to improve performance
5
  ENV PYTHONDONTWRITEBYTECODE 1
6
  ENV PYTHONUNBUFFERED 1
7
 
8
+ # Working directory
9
  WORKDIR /code
10
 
11
+ # Install build tools (required for some packages)
12
  RUN apt-get update && \
13
  apt-get install -y --no-install-recommends \
14
  build-essential && \
15
  rm -rf /var/lib/apt/lists/*
16
 
17
+ # Install dependencies
18
  COPY requirements.txt .
19
  RUN pip install --upgrade pip && pip install -r requirements.txt
20
 
21
+ # Copy code
22
  COPY . .
23
 
24
+ # Expose port
25
  EXPOSE 7860
26
 
27
+ # Start FastAPI app using uvicorn
28
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]