Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +13 -15
Dockerfile
CHANGED
|
@@ -1,19 +1,17 @@
|
|
| 1 |
-
# Use
|
| 2 |
-
FROM python:3.
|
| 3 |
|
| 4 |
-
# Set the working directory
|
| 5 |
-
WORKDIR /
|
| 6 |
|
| 7 |
-
# Copy and install the
|
| 8 |
-
COPY
|
| 9 |
-
RUN pip install --no-cache-dir -
|
| 10 |
|
| 11 |
-
# Copy the
|
| 12 |
-
COPY .
|
| 13 |
|
| 14 |
-
#
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
# It points to the 'app' instance in your 'main.py' file
|
| 19 |
-
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8080"]
|
|
|
|
| 1 |
+
# Use the official Python image as a base
|
| 2 |
+
FROM python:3.10
|
| 3 |
|
| 4 |
+
# Set the working directory inside the container
|
| 5 |
+
WORKDIR /app
|
| 6 |
|
| 7 |
+
# Copy the requirements file and install the dependencies
|
| 8 |
+
COPY requirements.txt requirements.txt
|
| 9 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 10 |
|
| 11 |
+
# Copy all the other files into the container
|
| 12 |
+
COPY . .
|
| 13 |
|
| 14 |
+
# Run the FastAPI app using Uvicorn
|
| 15 |
+
# The command specifies the module (main) and the app object (app) to run.
|
| 16 |
+
# It listens on all interfaces (0.0.0.0) and the default port (7860).
|
| 17 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
|
|