abdullahalioo commited on
Commit
748ec33
·
verified ·
1 Parent(s): 2608f72

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +40 -0
Dockerfile ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ fastapi
2
+ uvicorn
3
+ websockets
4
+ python-multipart
5
+
6
+ FROM python:3.10-slim
7
+
8
+ # Set working directory
9
+ WORKDIR /app
10
+
11
+ # Install system dependencies
12
+ RUN apt-get update && \
13
+ apt-get install -y --no-install-recommends \
14
+ build-essential \
15
+ git \
16
+ && rm -rf /var/lib/apt/lists/*
17
+
18
+
19
+
20
+ # Set environment variables
21
+
22
+
23
+ # Copy requirements first
24
+ COPY requirements.txt .
25
+
26
+ # Install Python dependencies
27
+ RUN pip install --upgrade pip && \
28
+ pip install --no-cache-dir -r requirements.txt
29
+
30
+ # Copy application code
31
+ COPY . .
32
+
33
+
34
+ USER myuser
35
+
36
+ # Expose port
37
+ EXPOSE 7860
38
+
39
+ # Run the app
40
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]