Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +22 -8
Dockerfile
CHANGED
@@ -1,15 +1,29 @@
|
|
1 |
-
# Use
|
2 |
-
FROM python:3.11
|
3 |
|
4 |
-
#
|
5 |
-
|
6 |
|
7 |
-
#
|
8 |
-
|
9 |
|
10 |
-
# Install requirements.txt
|
11 |
-
RUN pip install --no-cache-dir
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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"]
|