VishnuCodes commited on
Commit
91b7444
·
verified ·
1 Parent(s): d6aa5b6

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +31 -0
Dockerfile ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Base image with Python 3.9
2
+ FROM python:3.9-slim
3
+
4
+ # Set environment variables
5
+ ENV PYTHONDONTWRITEBYTECODE 1
6
+ ENV PYTHONUNBUFFERED 1
7
+
8
+ # Install system dependencies
9
+ RUN apt-get update && apt-get install -y --no-install-recommends \
10
+ gcc \
11
+ libgl1 \
12
+ libglib2.0-0 \
13
+ && rm -rf /var/lib/apt/lists/*
14
+
15
+ # Set the working directory
16
+ WORKDIR /app
17
+
18
+ # Copy requirements.txt into the container
19
+ COPY requirements.txt .
20
+
21
+ # Install Python dependencies
22
+ RUN pip install --no-cache-dir -r requirements.txt
23
+
24
+ # Copy the application code
25
+ COPY . .
26
+
27
+ # Expose the port for the FastAPI application
28
+ EXPOSE 7860
29
+
30
+ # Command to run the FastAPI app
31
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]