LogicGoInfotechSpaces commited on
Commit
3d8734c
·
verified ·
1 Parent(s): e5cd884

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +22 -0
Dockerfile ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use official PyTorch image with CUDA support (T4 compatible)
2
+ FROM pytorch/pytorch:2.1.0-cuda11.8-cudnn8-runtime
3
+
4
+ # Set working directory
5
+ WORKDIR /app
6
+
7
+ # Copy application files
8
+ COPY app.py .
9
+ COPY requirements.txt .
10
+
11
+ # Install Python dependencies
12
+ RUN pip install --upgrade pip
13
+ RUN pip install --no-cache-dir -r requirements.txt
14
+
15
+ # Expose port for FastAPI
16
+ EXPOSE 7860
17
+
18
+ # Set environment variables for MongoDB credentials if needed
19
+ # ENV MONGODB_URI="mongodb+srv://<user>:<password>@cluster.mongodb.net/?appName=API-LOGS"
20
+
21
+ # Command to run FastAPI with Uvicorn
22
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--reload"]