Spaces:
Sleeping
Sleeping
Update dockerfile
Browse files- dockerfile +6 -16
dockerfile
CHANGED
|
@@ -1,27 +1,17 @@
|
|
| 1 |
-
#
|
| 2 |
-
ARG MODEL_REPO_NAME
|
| 3 |
-
|
| 4 |
-
# Use the official Python image
|
| 5 |
FROM python:3.9
|
| 6 |
|
| 7 |
-
# Set the working directory
|
| 8 |
WORKDIR /app
|
| 9 |
|
| 10 |
# Copy application files
|
| 11 |
COPY . .
|
| 12 |
|
| 13 |
-
# Install
|
| 14 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 15 |
|
| 16 |
-
#
|
| 17 |
-
RUN python predict.py $MODEL_REPO_NAME
|
| 18 |
-
|
| 19 |
-
# Expose the correct port for Hugging Face Spaces
|
| 20 |
EXPOSE 7860
|
| 21 |
|
| 22 |
-
#
|
| 23 |
-
|
| 24 |
-
ENV FLASK_RUN_HOST=0.0.0.0
|
| 25 |
-
|
| 26 |
-
# Run the Flask application on port 7860
|
| 27 |
-
CMD ["flask", "run", "--host=0.0.0.0", "--port=7860"]
|
|
|
|
| 1 |
+
# Use official Python runtime
|
|
|
|
|
|
|
|
|
|
| 2 |
FROM python:3.9
|
| 3 |
|
| 4 |
+
# Set the working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
# Copy application files
|
| 8 |
COPY . .
|
| 9 |
|
| 10 |
+
# Install dependencies
|
| 11 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 12 |
|
| 13 |
+
# Expose the correct port for FastAPI
|
|
|
|
|
|
|
|
|
|
| 14 |
EXPOSE 7860
|
| 15 |
|
| 16 |
+
# Run the FastAPI app with Uvicorn
|
| 17 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
|
|
|
|
|
|
|
|