subbu123456 commited on
Commit
bb7c821
·
verified ·
1 Parent(s): d12f28d

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -5
Dockerfile CHANGED
@@ -1,6 +1,6 @@
1
  FROM python:3.10-slim
2
 
3
- # Install OS packages
4
  RUN apt-get update && apt-get install -y \
5
  git \
6
  gcc \
@@ -9,18 +9,18 @@ RUN apt-get update && apt-get install -y \
9
  build-essential \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
- # Copy and install Python dependencies
13
  COPY requirements.txt .
14
  RUN pip install --upgrade pip
15
  RUN pip install --no-cache-dir -r requirements.txt
16
 
17
- # Copy your FastAPI app
18
  WORKDIR /app
19
  COPY app /app
20
 
21
- # Avoid cache permission issues
22
  ENV TRANSFORMERS_CACHE=/app/app/model
23
 
24
- # Expose FastAPI port and run
25
  EXPOSE 7860
26
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM python:3.10-slim
2
 
3
+ # Install necessary OS packages
4
  RUN apt-get update && apt-get install -y \
5
  git \
6
  gcc \
 
9
  build-essential \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
+ # Copy requirements first for caching
13
  COPY requirements.txt .
14
  RUN pip install --upgrade pip
15
  RUN pip install --no-cache-dir -r requirements.txt
16
 
17
+ # Copy entire app
18
  WORKDIR /app
19
  COPY app /app
20
 
21
+ # Set transformers cache to local model folder (optional)
22
  ENV TRANSFORMERS_CACHE=/app/app/model
23
 
24
+ # Run FastAPI
25
  EXPOSE 7860
26
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]