spacesedan commited on
Commit
cef4a12
·
1 Parent(s): ad07efe
Files changed (1) hide show
  1. Dockerfile +9 -6
Dockerfile CHANGED
@@ -7,15 +7,18 @@ ENV PATH="/home/user/.local/bin:$PATH"
7
 
8
  WORKDIR /app
9
 
10
- # Copy and install Python requirements
11
- COPY --chown=user ./requirements.txt requirements.txt
12
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
13
 
14
- # Download NLTK 'punkt' tokenizer during build
15
- RUN python -c "import nltk; nltk.download('punkt')"
16
 
17
- # Copy the app source code
 
 
 
18
  COPY --chown=user . /app
19
 
20
- # Run the FastAPI app with Uvicorn
21
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
7
 
8
  WORKDIR /app
9
 
10
+ # Copy and install dependencies
11
+ COPY --chown=user requirements.txt .
12
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
13
 
14
+ # Download NLTK 'punkt' to a known path
15
+ RUN python -m nltk.downloader -d /home/user/nltk_data punkt
16
 
17
+ # Set env so NLTK can find the punkt data
18
+ ENV NLTK_DATA=/home/user/nltk_data
19
+
20
+ # Copy app source
21
  COPY --chown=user . /app
22
 
23
+ # Run the app
24
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]