khalednabawi11 commited on
Commit
d5a3a91
·
verified ·
1 Parent(s): 5ce009c

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +31 -0
Dockerfile ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9-slim
2
+
3
+ # Set working directory
4
+ WORKDIR /code
5
+
6
+ # Install system dependencies
7
+ RUN apt-get update && apt-get install -y \
8
+ build-essential \
9
+ git \
10
+ curl \
11
+ && rm -rf /var/lib/apt/lists/*
12
+
13
+ # Copy requirements and install
14
+ COPY app/requirements.txt .
15
+ RUN pip install --no-cache-dir -r requirements.txt
16
+
17
+ # Copy the entire app folder
18
+ COPY app/ ./app/
19
+
20
+ # Set the working directory to app/
21
+ WORKDIR /code/app
22
+
23
+ # Expose the port
24
+ EXPOSE 7860
25
+
26
+ # Environment variables (optional)
27
+ ENV HOST=0.0.0.0
28
+ ENV PORT=7860
29
+
30
+ # Run the FastAPI app
31
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]