Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files- Dockerfile +1 -1
- app.py +1 -1
- dockerfile +14 -0
Dockerfile
CHANGED
|
@@ -11,4 +11,4 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|
| 11 |
COPY superkart_model_v1_0.joblib /app/superkart_model_v1_0.joblib
|
| 12 |
COPY app.py /app/app.py
|
| 13 |
|
| 14 |
-
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:
|
|
|
|
| 11 |
COPY superkart_model_v1_0.joblib /app/superkart_model_v1_0.joblib
|
| 12 |
COPY app.py /app/app.py
|
| 13 |
|
| 14 |
+
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:5000", "app:app"]
|
app.py
CHANGED
|
@@ -87,4 +87,4 @@ def predict():
|
|
| 87 |
if __name__ == '__main__':
|
| 88 |
# This block is typically used when running the Flask app directly
|
| 89 |
# For deployment with Gunicorn/other WSGI servers, this might be removed or modified
|
| 90 |
-
|
|
|
|
| 87 |
if __name__ == '__main__':
|
| 88 |
# This block is typically used when running the Flask app directly
|
| 89 |
# For deployment with Gunicorn/other WSGI servers, this might be removed or modified
|
| 90 |
+
app.run(host='0.0.0.0', port=int(os.environ.get('PORT', 5000)))
|
dockerfile
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
FROM python:3.9
|
| 3 |
+
|
| 4 |
+
RUN useradd -m -u 1000 user
|
| 5 |
+
USER user
|
| 6 |
+
ENV PATH="/home/user/.local/bin:$PATH"
|
| 7 |
+
|
| 8 |
+
WORKDIR /app
|
| 9 |
+
|
| 10 |
+
COPY --chown=user ./requirements.txt requirements.txt
|
| 11 |
+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 12 |
+
|
| 13 |
+
COPY --chown=user . /app
|
| 14 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|