ikoghoemmanuell
commited on
Commit
•
a245bef
1
Parent(s):
4f626e3
Update Dockerfile
Browse files- Dockerfile +7 -11
Dockerfile
CHANGED
@@ -1,20 +1,16 @@
|
|
1 |
# Use the official Python image as the base image
|
2 |
FROM python:3.9
|
3 |
|
4 |
-
#
|
5 |
-
WORKDIR /
|
6 |
-
|
7 |
# Copy the requirements.txt file to the container
|
8 |
-
COPY requirements.txt .
|
9 |
|
10 |
# Install the Python dependencies
|
11 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
12 |
-
|
13 |
-
# Copy the FastAPI app code to the container
|
14 |
-
COPY main.py .
|
15 |
|
16 |
-
#
|
17 |
-
|
18 |
|
19 |
# Start the FastAPI app with Uvicorn when the container starts
|
20 |
-
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "
|
|
|
1 |
# Use the official Python image as the base image
|
2 |
FROM python:3.9
|
3 |
|
4 |
+
# Set the working directory in the container
|
5 |
+
WORKDIR /code
|
|
|
6 |
# Copy the requirements.txt file to the container
|
7 |
+
COPY app/requirements.txt /code/requirements.txt
|
8 |
|
9 |
# Install the Python dependencies
|
10 |
+
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
|
|
|
|
|
|
11 |
|
12 |
+
# copy all the files in the app folder
|
13 |
+
COPY app/ .
|
14 |
|
15 |
# Start the FastAPI app with Uvicorn when the container starts
|
16 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|