Spaces:
Sleeping
Sleeping
denovoref commited on
Commit ·
d0811d9
1
Parent(s): 4a3ff34
changed dockerfile and app
Browse files- dockerfile +5 -9
- 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
|
| 17 |
EXPOSE 7860
|
| 18 |
|
| 19 |
-
# Set
|
| 20 |
-
ENV
|
| 21 |
-
ENV FLASK_RUN_HOST=0.0.0.0
|
| 22 |
-
ENV FLASK_RUN_PORT=7860
|
| 23 |
|
| 24 |
-
# Start the
|
| 25 |
-
CMD ["
|
| 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(
|
|
|
|
| 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)
|