abadesalex commited on
Commit
47ffab5
1 Parent(s): c0dff48

docker updated

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -18
Dockerfile CHANGED
@@ -1,23 +1,18 @@
1
- # Use an official Python runtime as a parent image
2
- FROM python:3.10-slim
3
 
4
- # Set the working directory in the container
5
- WORKDIR /usr/src/app
6
 
7
- # Copy the requirements file into the container at /usr/src/app
8
- COPY requirements.txt ./
9
 
10
- # Install any needed packages specified in requirements.txt
11
- RUN pip install --no-cache-dir -r requirements.txt
12
 
13
- # Copy the app directory into the container at /usr/src/app/app
14
- COPY app ./app
15
 
16
- # Copy the main.py into the container at /usr/src/app
17
- COPY main.py ./
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"]