denovoref commited on
Commit
d0811d9
·
1 Parent(s): 4a3ff34

changed dockerfile and app

Browse files
Files changed (2) hide show
  1. dockerfile +5 -9
  2. src/search_engine/app.py +1 -1
dockerfile CHANGED
@@ -13,15 +13,11 @@ RUN pip install --no-cache-dir -r requirements.txt
13
  # Copy the source code into the container
14
  COPY src/ /app/src/
15
 
16
- # Expose the port Flask will run on (port 7860 is expected for Hugging Face Spaces)
17
  EXPOSE 7860
18
 
19
- # Set Flask environment variables
20
- ENV FLASK_APP=src/search_engine/app.py
21
- ENV FLASK_RUN_HOST=0.0.0.0
22
- ENV FLASK_RUN_PORT=7860
23
 
24
- # Start the Flask app when the container starts
25
- CMD ["flask", "run", "--host=0.0.0.0", "--port=7860"]
26
-
27
- #CMD ["python", "src/search_engine/app.py"]
 
13
  # Copy the source code into the container
14
  COPY src/ /app/src/
15
 
16
+ # Expose the port the app will run on (port 7860 is expected for Hugging Face Spaces)
17
  EXPOSE 7860
18
 
19
+ # Set environment variables
20
+ ENV PYTHONUNBUFFERED=1
 
 
21
 
22
+ # Start the app when the container launches
23
+ CMD ["python", "src/search_engine/app.py"]
 
 
src/search_engine/app.py CHANGED
@@ -19,4 +19,4 @@ def search_request():
19
 
20
  # Start the Flask development server if the script is run directly
21
  if __name__ == '__main__':
22
- app.run(debug=True)
 
19
 
20
  # Start the Flask development server if the script is run directly
21
  if __name__ == '__main__':
22
+ app.run(host='0.0.0.0', port=7860)