Gokulavelan commited on
Commit
e396e5a
·
1 Parent(s): 629c3f3
Files changed (2) hide show
  1. Dockerfile +7 -2
  2. main.py → app/main.py +0 -0
Dockerfile CHANGED
@@ -5,13 +5,18 @@ FROM python:3.9-slim
5
  ENV PYTHONUNBUFFERED=1 \
6
  PYTHONDONTWRITEBYTECODE=1
7
 
 
 
 
8
  # Copy and install dependencies
9
  COPY requirements.txt .
10
  RUN pip install --no-cache-dir -r requirements.txt
11
 
 
 
12
 
13
  # Expose the FastAPI port
14
  EXPOSE 8000
15
 
16
- # Run FastAPI (fix import issue by using `app.main`)
17
- CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
 
5
  ENV PYTHONUNBUFFERED=1 \
6
  PYTHONDONTWRITEBYTECODE=1
7
 
8
+ # Set working directory inside the container
9
+ WORKDIR /app
10
+
11
  # Copy and install dependencies
12
  COPY requirements.txt .
13
  RUN pip install --no-cache-dir -r requirements.txt
14
 
15
+ # Copy the entire project (including main.py in root)
16
+ COPY . /app
17
 
18
  # Expose the FastAPI port
19
  EXPOSE 8000
20
 
21
+ # Run FastAPI (use `main` instead of `app.main`)
22
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
main.py → app/main.py RENAMED
File without changes