Update Dockerfile
Browse files- Dockerfile +10 -10
Dockerfile
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
-
# Use the official Python image as a base
|
2 |
FROM python:3.9-slim
|
3 |
|
4 |
# Install necessary system dependencies
|
@@ -9,23 +8,24 @@ RUN apt-get update && apt-get install -y \
|
|
9 |
libssl-dev \
|
10 |
&& rm -rf /var/lib/apt/lists/*
|
11 |
|
12 |
-
#
|
13 |
-
|
14 |
|
15 |
-
#
|
|
|
|
|
|
|
16 |
WORKDIR /app
|
17 |
|
18 |
-
# Copy
|
19 |
COPY requirements.txt ./
|
20 |
-
|
21 |
-
# Install Python dependencies
|
22 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
23 |
|
24 |
-
# Copy the application code
|
25 |
COPY . .
|
26 |
|
27 |
-
# Expose
|
28 |
EXPOSE 7860
|
29 |
|
30 |
-
# Command to run the FastAPI application
|
31 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
|
1 |
FROM python:3.9-slim
|
2 |
|
3 |
# Install necessary system dependencies
|
|
|
8 |
libssl-dev \
|
9 |
&& rm -rf /var/lib/apt/lists/*
|
10 |
|
11 |
+
# Create a directory for NLTK data
|
12 |
+
RUN mkdir -p /app/nltk_data
|
13 |
|
14 |
+
# Set environment variable for NLTK data
|
15 |
+
ENV NLTK_DATA=/app/nltk_data
|
16 |
+
|
17 |
+
# Set the working directory
|
18 |
WORKDIR /app
|
19 |
|
20 |
+
# Copy requirements and install dependencies
|
21 |
COPY requirements.txt ./
|
|
|
|
|
22 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
23 |
|
24 |
+
# Copy the application code
|
25 |
COPY . .
|
26 |
|
27 |
+
# Expose port
|
28 |
EXPOSE 7860
|
29 |
|
30 |
+
# Command to run the FastAPI application
|
31 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|