Factor Studios commited on
Commit
1cec79f
·
verified ·
1 Parent(s): 614bb79

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +34 -0
Dockerfile ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ # Set working directory
4
+ WORKDIR /app
5
+
6
+ # Install system dependencies
7
+ RUN apt-get update && apt-get install -y \
8
+
9
+ build-essential \
10
+ python3-dev \
11
+ && rm -rf /var/lib/apt/lists/*
12
+
13
+
14
+ # Copy requirements and install Python dependencies
15
+ COPY requirements.txt .
16
+ RUN pip install --no-cache-dir -r requirements.txt
17
+
18
+ # Copy application files
19
+ COPY . .
20
+
21
+ RUN useradd -m -u 1000 user
22
+
23
+ RUN chmod -R 777 /app
24
+
25
+ # Set environment variables
26
+ ENV FLASK_APP=app.py
27
+ ENV FLASK_ENV=production
28
+ ENV PORT=7860
29
+
30
+ # Expose port
31
+ EXPOSE 7860
32
+
33
+ # Run the application
34
+ CMD ["uvicorn", "app", "--host", "0.0.0.0", "--port", "7860"]