vasdevaman6 commited on
Commit
8b7f2d3
ยท
verified ยท
1 Parent(s): aed4cdd

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -6
Dockerfile CHANGED
@@ -1,7 +1,7 @@
1
  # 1. Base Image: Use a stable, slim Python image
2
  FROM python:3.10-slim
3
 
4
- # Set the environment variable for Python
5
  ENV PYTHONUNBUFFERED 1
6
 
7
  # 2. System Dependencies: Install libraries required for image processing
@@ -19,15 +19,19 @@ WORKDIR /app
19
  COPY requirements.txt .
20
  RUN pip install --no-cache-dir -r requirements.txt
21
 
22
- # ๐Ÿ›‘ CRITICAL FIX FOR EASYOCR PERMISSION: ๐Ÿ›‘
23
- # Create the necessary writable directories including user_network
24
- RUN mkdir -p /app/easyocr_models/user_network && chmod -R 777 /app/easyocr_models
 
 
 
 
25
 
26
- # 3b. Copy the rest of your application code and models
27
  COPY . .
28
 
29
  # 4. Deployment Configuration
30
  ENV PORT 7860
31
 
32
- # Run the application using Gunicorn (the production web server)
33
  CMD exec gunicorn --bind 0.0.0.0:$PORT --workers 1 --threads 8 app:app
 
1
  # 1. Base Image: Use a stable, slim Python image
2
  FROM python:3.10-slim
3
 
4
+ # Set Python environment variable
5
  ENV PYTHONUNBUFFERED 1
6
 
7
  # 2. System Dependencies: Install libraries required for image processing
 
19
  COPY requirements.txt .
20
  RUN pip install --no-cache-dir -r requirements.txt
21
 
22
+ # ๐Ÿ›‘ Create all necessary writable directories
23
+ # EasyOCR model storage + user network
24
+ RUN mkdir -p /app/easyocr_models/user_network
25
+ # Uploads folder
26
+ RUN mkdir -p /app/uploads
27
+ # Give full permissions to avoid PermissionError
28
+ RUN chmod -R 777 /app/easyocr_models /app/uploads
29
 
30
+ # 3b. Copy the rest of your application code
31
  COPY . .
32
 
33
  # 4. Deployment Configuration
34
  ENV PORT 7860
35
 
36
+ # 5. Run the application using Gunicorn
37
  CMD exec gunicorn --bind 0.0.0.0:$PORT --workers 1 --threads 8 app:app