LiamKhoaLe commited on
Commit
0bf9e71
·
1 Parent(s): 74ae0b8

Fix FastAPI import error

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -3
Dockerfile CHANGED
@@ -8,12 +8,15 @@ ENV PATH="/home/user/.local/bin:$PATH"
8
  # Set working directory
9
  WORKDIR /app
10
 
11
- # Copy and install dependencies
12
- COPY --chown=user ./requirements.txt requirements.txt
13
- RUN pip install --no-cache-dir -r requirements.txt
14
 
15
  # Load environment variables
16
  ENV ENV_PATH="/app/.env"
17
 
 
 
 
18
  # Run server with uvicorn
19
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
8
  # Set working directory
9
  WORKDIR /app
10
 
11
+ # Copy all project files to the container then install modules
12
+ COPY --chown=user . .
13
+ RUN pip install --no-cache-dir -r requirements.txt
14
 
15
  # Load environment variables
16
  ENV ENV_PATH="/app/.env"
17
 
18
+ # Ensure Python can find the app
19
+ ENV PYTHONPATH=/app
20
+
21
  # Run server with uvicorn
22
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]