Spaces:
Sleeping
Sleeping
abadesalex
commited on
Commit
•
47ffab5
1
Parent(s):
c0dff48
docker updated
Browse files- Dockerfile +13 -18
Dockerfile
CHANGED
@@ -1,23 +1,18 @@
|
|
1 |
-
# Use
|
2 |
-
FROM python:3.
|
3 |
|
4 |
-
# Set the working directory
|
5 |
-
WORKDIR /
|
6 |
|
7 |
-
# Copy the requirements
|
8 |
-
COPY requirements.txt
|
9 |
|
10 |
-
# Install
|
11 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
12 |
|
13 |
-
# Copy the
|
14 |
-
COPY app
|
15 |
|
16 |
-
#
|
17 |
-
|
18 |
-
|
19 |
-
# Make port 8000 available to the world outside this container
|
20 |
-
EXPOSE 8000
|
21 |
-
|
22 |
-
# Run uvicorn server
|
23 |
-
CMD ["uvicorn", "app.api:app", "--host", "0.0.0.0", "--port", "8000"]
|
|
|
1 |
+
# Use Python 3.9 as base image
|
2 |
+
FROM python:3.9
|
3 |
|
4 |
+
# Set the working directory inside the container to /code
|
5 |
+
WORKDIR /code
|
6 |
|
7 |
+
# Copy the requirements.txt from the FastAPI folder into the working directory in the container
|
8 |
+
COPY ./FastAPI/requirements.txt /code/requirements.txt
|
9 |
|
10 |
+
# Install the Python packages specified in requirements.txt without cache and upgrading them
|
11 |
+
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
12 |
|
13 |
+
# Copy the FastAPI application directory into the working directory
|
14 |
+
COPY ./FastAPI/app /code/app
|
15 |
|
16 |
+
# Set the command to run the application using Uvicorn
|
17 |
+
# CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|
18 |
+
CMD ["python", "app/main.py"]
|
|
|
|
|
|
|
|
|
|