ALQAMARI commited on
Commit
75678ac
·
verified ·
1 Parent(s): b99ef36

Change in the folder location of the .py file

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -7
Dockerfile CHANGED
@@ -1,15 +1,15 @@
 
1
  FROM python:3.10-slim
2
 
 
3
  WORKDIR /code
4
 
5
- # Copy and install requirements
6
  COPY ./requirements.txt /code/requirements.txt
7
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
8
 
9
- # Copy your application code
10
- # Assuming main.py is in a sub-folder named 'app'
11
- # If main.py is in the root, change the next line to: COPY ./main.py /code/
12
- COPY ./app /code/app
13
 
14
- # The port needs to be 7860 for Hugging Face Spaces to expose it
15
- CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
 
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 /code
6
 
7
+ # Copy the requirements file and install dependencies
8
  COPY ./requirements.txt /code/requirements.txt
9
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
10
 
11
+ # Copy the main application file from the root directory
12
+ COPY ./main.py /code/main.py
 
 
13
 
14
+ # Command to run the app. Note we use "main:app" instead of "app.main:app"
15
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]