pranit144 commited on
Commit
11a2cd3
·
verified ·
1 Parent(s): 6a82b7b

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +27 -0
Dockerfile ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Base image
2
+ FROM python:3.9-slim
3
+
4
+ # Set the working directory
5
+ WORKDIR /app
6
+
7
+ # Copy application files
8
+ COPY . /app
9
+
10
+ # Ensure the uploads folder exists and is writable
11
+ RUN mkdir -p static/uploads && chmod -R 777 static/uploads
12
+
13
+ # --- NEW ADDITION ---
14
+ # Ensure the data directory exists and is writable
15
+ # This explicitly creates the /app/data directory and grants full permissions
16
+ # (read, write, execute for all users) to ensure the application can write to it.
17
+ RUN mkdir -p data && chmod -R 777 data
18
+ # --- END NEW ADDITION ---
19
+
20
+ # Install dependencies
21
+ RUN pip install --no-cache-dir -r requirements.txt
22
+
23
+ # Expose the port your app runs on
24
+ EXPOSE 7860
25
+
26
+ # Run the application with Gunicorn and increase the worker timeout to 30 seconds
27
+ CMD ["gunicorn", "-w", "4", "--timeout", "30", "-b", "0.0.0.0:7860", "app:app"]