WebashalarForML commited on
Commit
efcd956
·
verified ·
1 Parent(s): 8c6b408

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +55 -0
Dockerfile ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.11-slim
3
+
4
+ WORKDIR /app
5
+
6
+ # Set environment variables for Hugging Face cache
7
+ ENV DEBIAN_FRONTEND=noninteractive \
8
+ PYTHONUNBUFFERED=1 \
9
+ PYTHONDONTWRITEBYTECODE=1 \
10
+ TRANSFORMERS_CACHE=/app/cache \
11
+ HF_HOME=/app/cache \
12
+ NLTK_DATA=/app/nltk_data \
13
+ MPLCONFIGDIR=/app/.config/matplotlib
14
+
15
+ COPY requirements.txt requirements.txt
16
+ COPY static/ /app/static
17
+ COPY app.py app.py
18
+ COPY medicationCategories/ /app/medicationCategories/
19
+ COPY reports/ /app/reports/
20
+ # COPY OUTPUTS/ /app/OUTPUTS
21
+ COPY . /app/
22
+ COPY . .
23
+
24
+ # Install system dependencies
25
+ RUN apt-get update && apt-get install -y \
26
+ build-essential \
27
+ libglib2.0-0 \
28
+ libsm6 \
29
+ libxext6 \
30
+ libxrender-dev \
31
+ tesseract-ocr \
32
+ poppler-utils \
33
+ libgl1 \
34
+ # ffmpeg \
35
+ # libopencv-dev \
36
+ curl \
37
+ ca-certificates \
38
+ && apt-get clean \
39
+ && rm -rf /var/lib/apt/lists/*
40
+
41
+ RUN pip install --upgrade pip && pip install -r requirements.txt
42
+
43
+ # Create necessary directories with correct permissions
44
+ RUN mkdir -p /app/nltk_data /app/.config/matplotlib \
45
+ && mkdir -p /app/cache /app/data /app/logs /app/static \
46
+ && chmod -R 777 /app/cache /app/data /app/logs /app/static /app/medicationCategories /app/reports \
47
+ && chmod -R 777 /app
48
+
49
+ # Set Flask environment variables
50
+ ENV FLASK_APP=app.py \
51
+ FLASK_ENV=production
52
+
53
+ # Expose port and start application
54
+ EXPOSE 7860
55
+ CMD ["python", "app.py"]