logeswari commited on
Commit
41d9d67
·
1 Parent(s): 061b971
Files changed (2) hide show
  1. Dockerfile +23 -9
  2. app.py → main.py +0 -0
Dockerfile CHANGED
@@ -1,21 +1,35 @@
1
- # Use an official Python image as a base
2
  FROM python:3.9-slim
3
 
4
- # Set environment variables
5
  ENV PYTHONDONTWRITEBYTECODE=1
6
  ENV PYTHONUNBUFFERED=1
7
 
8
- # Install dependencies
9
- RUN pip install --no-cache-dir fastapi uvicorn
 
 
 
 
 
 
 
 
10
 
11
  # Create a directory for the app
12
  WORKDIR /app
13
 
14
- # Copy your application code
15
- COPY . /app
16
 
17
- # Expose the port for the FastAPI app
 
 
 
 
 
 
18
  EXPOSE 8000
19
 
20
- # Run the application with Uvicorn
21
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
 
1
+ # Use an official Python image as the base image
2
  FROM python:3.9-slim
3
 
4
+ # Set environment variables to prevent Python from buffering output
5
  ENV PYTHONDONTWRITEBYTECODE=1
6
  ENV PYTHONUNBUFFERED=1
7
 
8
+ # Install necessary system dependencies
9
+ RUN apt-get update && apt-get install -y \
10
+ build-essential \
11
+ libopenblas-dev \
12
+ liblapack-dev \
13
+ libglib2.0-0 \
14
+ libgl1-mesa-glx \
15
+ libstdc++6 \
16
+ wget \
17
+ && rm -rf /var/lib/apt/lists/*
18
 
19
  # Create a directory for the app
20
  WORKDIR /app
21
 
22
+ # Copy the requirements file
23
+ COPY requirements.txt /app/
24
 
25
+ # Install Python dependencies
26
+ RUN pip install --no-cache-dir -r requirements.txt
27
+
28
+ # Copy the application code
29
+ COPY . /app/
30
+
31
+ # Expose the FastAPI application port
32
  EXPOSE 8000
33
 
34
+ # Command to run the application
35
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
app.py → main.py RENAMED
File without changes