pvanand commited on
Commit
dba288f
1 Parent(s): fd9d115

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +22 -8
Dockerfile CHANGED
@@ -1,15 +1,29 @@
1
- # Use the official Python 3.11 image
2
- FROM python:3.11
3
 
4
- # Copy the current directory contents into the container at .
5
- COPY . .
6
 
7
- # Set the working directory to /
8
- WORKDIR /
9
 
10
- # Install requirements.txt
11
- RUN pip install --no-cache-dir --upgrade -r /requirements.txt
 
 
 
 
 
 
 
 
12
  RUN python -m nltk.downloader stopwords punkt
13
 
 
 
 
 
 
 
14
  # Start the FastAPI app on port 7860, the default port expected by Spaces
15
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.11-slim
3
 
4
+ # Set the working directory in the container
5
+ WORKDIR /app
6
 
7
+ # Copy the current directory contents into the container at /app
8
+ COPY . /app
9
 
10
+ # Install any needed packages specified in requirements.txt
11
+ RUN pip install --no-cache-dir -r requirements.txt
12
+
13
+ # Create a directory for NLTK data
14
+ RUN mkdir -p /app/nltk_data
15
+
16
+ # Set the NLTK_DATA environment variable
17
+ ENV NLTK_DATA=/app/nltk_data
18
+
19
+ # Download NLTK data
20
  RUN python -m nltk.downloader stopwords punkt
21
 
22
+ # Make port 80 available to the world outside this container
23
+ EXPOSE 80
24
+
25
+ # Define environment variable
26
+ ENV NAME World
27
+
28
  # Start the FastAPI app on port 7860, the default port expected by Spaces
29
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]