Spaces:
Sleeping
Sleeping
Update dockerfile
Browse files- dockerfile +7 -1
dockerfile
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# Use the official Python image
|
| 2 |
FROM python:3.9
|
| 3 |
|
|
@@ -10,6 +13,9 @@ COPY . .
|
|
| 10 |
# Install required dependencies
|
| 11 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 12 |
|
|
|
|
|
|
|
|
|
|
| 13 |
# Expose the correct port for Hugging Face Spaces
|
| 14 |
EXPOSE 7860
|
| 15 |
|
|
@@ -18,4 +24,4 @@ ENV FLASK_APP=app.py
|
|
| 18 |
ENV FLASK_RUN_HOST=0.0.0.0
|
| 19 |
|
| 20 |
# Run the Flask application on port 7860
|
| 21 |
-
CMD ["flask", "run", "--host=0.0.0.0", "--port=7860"]
|
|
|
|
| 1 |
+
# Declare your environment variables with the ARG directive
|
| 2 |
+
ARG MODEL_REPO_NAME
|
| 3 |
+
|
| 4 |
# Use the official Python image
|
| 5 |
FROM python:3.9
|
| 6 |
|
|
|
|
| 13 |
# Install required dependencies
|
| 14 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 15 |
|
| 16 |
+
# Use the build-time variable in the command
|
| 17 |
+
RUN python predict.py $MODEL_REPO_NAME
|
| 18 |
+
|
| 19 |
# Expose the correct port for Hugging Face Spaces
|
| 20 |
EXPOSE 7860
|
| 21 |
|
|
|
|
| 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"]
|