Sp2503 commited on
Commit
20d7f69
·
verified ·
1 Parent(s): 9a8da73

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -15
Dockerfile CHANGED
@@ -1,19 +1,17 @@
1
- # Use an official Python runtime
2
- FROM python:3.9
3
 
4
- # Set the working directory
5
- WORKDIR /code
6
 
7
- # Copy and install the requirements
8
- COPY ./requirements.txt /code/requirements.txt
9
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
10
 
11
- # Copy the rest of your application files
12
- COPY . /code/app
13
 
14
- # Set the working directory to your app folder
15
- WORKDIR /code/app
16
-
17
- # The command to run your API
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"]