Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +12 -7
Dockerfile
CHANGED
|
@@ -3,13 +3,18 @@
|
|
| 3 |
# Use an official Python runtime as a parent image
|
| 4 |
FROM python:3.9
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
|
| 9 |
-
|
|
|
|
| 10 |
|
| 11 |
-
|
| 12 |
-
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 13 |
|
| 14 |
-
|
| 15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
# Use an official Python runtime as a parent image
|
| 4 |
FROM python:3.9
|
| 5 |
|
| 6 |
+
# Set the working directory in the container
|
| 7 |
+
WORKDIR /code
|
| 8 |
|
| 9 |
+
# Copy the requirements file into the container
|
| 10 |
+
COPY ./requirements.txt /code/requirements.txt
|
| 11 |
|
| 12 |
+
# Install any needed packages specified in requirements.txt
|
| 13 |
+
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
| 14 |
|
| 15 |
+
# Copy the main application code into the container
|
| 16 |
+
COPY ./main.py /code/main.py
|
| 17 |
+
|
| 18 |
+
# Command to run the app.
|
| 19 |
+
# Hugging Face Spaces expects the app to run on host 0.0.0.0 and port 7860.
|
| 20 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|