smitb2005 commited on
Commit
e654cb0
·
1 Parent(s): 3ceb7bf

modified dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -3
Dockerfile CHANGED
@@ -1,7 +1,8 @@
1
  FROM python:3.11-alpine
2
 
3
  ENV PYTHONDONTWRITEBYTECODE=1 \
4
- PYTHONUNBUFFERED=1
 
5
 
6
  WORKDIR /app
7
 
@@ -24,12 +25,15 @@ RUN python -m pip install --upgrade pip setuptools wheel
24
  COPY requirements.txt /app/requirements.txt
25
  RUN pip install --no-cache-dir -r /app/requirements.txt
26
 
 
 
 
27
  # remove build deps to slim image
28
  RUN apk del .build-deps
29
 
30
  # copy app and rag file
31
  COPY . /app
32
 
33
- EXPOSE 7648
34
 
35
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7648"]
 
1
  FROM python:3.11-alpine
2
 
3
  ENV PYTHONDONTWRITEBYTECODE=1 \
4
+ PYTHONUNBUFFERED=1 \
5
+ NLTK_DATA=/app/nltk_data
6
 
7
  WORKDIR /app
8
 
 
25
  COPY requirements.txt /app/requirements.txt
26
  RUN pip install --no-cache-dir -r /app/requirements.txt
27
 
28
+ # pre-download NLTK models into writable dir
29
+ RUN python -c "import nltk; nltk.download('punkt', download_dir='/app/nltk_data'); nltk.download('averaged_perceptron_tagger_eng', download_dir='/app/nltk_data')"
30
+
31
  # remove build deps to slim image
32
  RUN apk del .build-deps
33
 
34
  # copy app and rag file
35
  COPY . /app
36
 
37
+ EXPOSE 7860
38
 
39
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]