Commit
Β·
293d75c
1
Parent(s):
d2020f6
fix: Use dynamic from platform in Docker CMD
Browse files- Dockerfile +7 -5
- README.md +0 -1
Dockerfile
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
# Start with the official Python 3.11 image
|
| 2 |
FROM python:3.11
|
| 3 |
|
| 4 |
# Set the working directory inside the container
|
|
@@ -20,8 +20,10 @@ RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
|
| 20 |
# Copy the rest of your application code
|
| 21 |
COPY . .
|
| 22 |
|
| 23 |
-
#
|
| 24 |
-
EXPOSE
|
| 25 |
|
| 26 |
-
#
|
| 27 |
-
|
|
|
|
|
|
|
|
|
| 1 |
+
# Start with the official Python 3.11 image
|
| 2 |
FROM python:3.11
|
| 3 |
|
| 4 |
# Set the working directory inside the container
|
|
|
|
| 20 |
# Copy the rest of your application code
|
| 21 |
COPY . .
|
| 22 |
|
| 23 |
+
# EXPOSE the PORT variable that will be provided by Hugging Face
|
| 24 |
+
EXPOSE ${PORT}
|
| 25 |
|
| 26 |
+
# β
THE FINAL FIX IS HERE
|
| 27 |
+
# Command to run the application using the PORT provided by the platform environment
|
| 28 |
+
# If $PORT is not set, it will default to 7860 for local testing
|
| 29 |
+
CMD ["uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "${PORT:-7860}"]
|
README.md
CHANGED
|
@@ -4,7 +4,6 @@ emoji: π
|
|
| 4 |
colorFrom: indigo
|
| 5 |
colorTo: purple
|
| 6 |
sdk: docker
|
| 7 |
-
app_port: 7860
|
| 8 |
pinned: false
|
| 9 |
license: mit
|
| 10 |
---
|
|
|
|
| 4 |
colorFrom: indigo
|
| 5 |
colorTo: purple
|
| 6 |
sdk: docker
|
|
|
|
| 7 |
pinned: false
|
| 8 |
license: mit
|
| 9 |
---
|