Upload folder using huggingface_hub
Browse files- Dockerfile +9 -9
- app.py +1 -1
- requirements.txt +5 -0
Dockerfile
CHANGED
|
@@ -1,16 +1,16 @@
|
|
| 1 |
-
# Use a minimal base image with Python 3.9 installed
|
| 2 |
FROM python:3.9-slim
|
| 3 |
|
| 4 |
-
# Set the working directory inside the container
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
# Copy all files from the current directory
|
| 8 |
COPY . .
|
| 9 |
|
| 10 |
-
# Install
|
| 11 |
-
RUN
|
| 12 |
|
| 13 |
-
# Define the command to
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
#
|
|
|
|
|
|
|
|
|
| 1 |
FROM python:3.9-slim
|
| 2 |
|
| 3 |
+
# Set the working directory inside the container
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
+
# Copy all files from the current directory to the container's working directory
|
| 7 |
COPY . .
|
| 8 |
|
| 9 |
+
# Install dependencies from the requirements file without using cache to reduce image size
|
| 10 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 11 |
|
| 12 |
+
# Define the command to start the application using Gunicorn with 4 worker processes
|
| 13 |
+
# - `-w 4`: Uses 4 worker processes for handling requests
|
| 14 |
+
# - `-b 0.0.0.0:7860`: Binds the server to port 7860 on all network interfaces
|
| 15 |
+
# - `app:app`: Runs the Flask app (assuming `app.py` contains the Flask instance named `app`)
|
| 16 |
+
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:7860", "app:app"]
|
app.py
CHANGED
|
@@ -32,4 +32,4 @@ def predict_sales():
|
|
| 32 |
return jsonify({'prediction': prediction})
|
| 33 |
|
| 34 |
if __name__ == '__main__':
|
| 35 |
-
app.run(debug=True)
|
|
|
|
| 32 |
return jsonify({'prediction': prediction})
|
| 33 |
|
| 34 |
if __name__ == '__main__':
|
| 35 |
+
app.run(debug=True,host="0.0.0.0", port=7860)
|
requirements.txt
CHANGED
|
@@ -3,4 +3,9 @@ numpy==2.0.2
|
|
| 3 |
scikit-learn==1.6.1
|
| 4 |
xgboost==2.1.4
|
| 5 |
joblib==1.4.2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
streamlit==1.43.2
|
|
|
|
| 3 |
scikit-learn==1.6.1
|
| 4 |
xgboost==2.1.4
|
| 5 |
joblib==1.4.2
|
| 6 |
+
Werkzeug==2.2.2
|
| 7 |
+
flask==2.2.2
|
| 8 |
+
gunicorn==20.1.0
|
| 9 |
+
requests==2.28.1
|
| 10 |
+
uvicorn[standard]
|
| 11 |
streamlit==1.43.2
|