garvitcpp commited on
Commit
3bf01d0
·
verified ·
1 Parent(s): c30b4ba

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +48 -0
Dockerfile ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.12
2
+
3
+ WORKDIR /code
4
+
5
+ # Install packages manually
6
+ RUN pip install flask==3.0.0 && \
7
+ pip install openai==0.28.0 && \
8
+ pip install python-dotenv==1.0.0 && \
9
+ pip install google-generativeai==0.3.2 && \
10
+ pip install pillow==10.1.0 && \
11
+ pip install beautifulsoup4==4.12.2 && \
12
+ pip install joblib==1.3.2 && \
13
+ pip install scipy==1.11.4 && \
14
+ pip install pandas==2.1.3 && \
15
+ pip install scikit-learn==1.3.2 && \
16
+ pip install flask-cors==4.0.0 && \
17
+ pip install "flask[async]"==3.0.0 && \
18
+ pip install gunicorn==21.2.0
19
+
20
+ # Copy the entire app directory with all subdirectories
21
+ COPY ./app /code/app
22
+ # This includes:
23
+ # - app/__pycache__
24
+ # - app/api
25
+ # - app/models
26
+ # - app/services
27
+ # - app/utils
28
+ # - app/__init__.py
29
+ # - app/main.py
30
+
31
+ # Copy other necessary files
32
+ COPY ./.env /code/.env
33
+ COPY ./run.py /code/run.py
34
+ COPY ./config.py /code/config.py
35
+ COPY ./precomputed /code/precomputed
36
+ COPY ./recipe_dataset.csv /code/recipe_dataset.csv
37
+
38
+ # Create directory for any cache or temporary files
39
+ RUN mkdir -p /code/tmp
40
+
41
+ # Set proper permissions
42
+ RUN chmod -R 755 /code
43
+
44
+ # Clean up any cached files
45
+ RUN find /code -type d -name "__pycache__" -exec rm -r {} + 2>/dev/null || true
46
+
47
+ # Command to run the application
48
+ CMD ["python", "run.py"]