Update Dockerfile
Browse files- Dockerfile +14 -17
Dockerfile
CHANGED
@@ -1,32 +1,29 @@
|
|
1 |
-
|
|
|
2 |
|
3 |
-
# Set working directory
|
4 |
WORKDIR /app
|
5 |
|
6 |
-
#
|
7 |
-
|
8 |
-
ENV NLTK_DATA="/tmp/nltk_data"
|
9 |
|
10 |
-
#
|
11 |
-
|
12 |
|
13 |
-
# Install NLTK
|
14 |
RUN pip install nltk
|
15 |
|
16 |
-
#
|
17 |
-
RUN python -m nltk.downloader vader_lexicon -d $NLTK_DATA
|
18 |
-
|
19 |
-
# Copy requirements.txt
|
20 |
COPY requirements.txt requirements.txt
|
21 |
|
22 |
-
# Install dependencies
|
23 |
RUN pip install -r requirements.txt
|
24 |
|
25 |
-
# Copy the rest of the application
|
26 |
COPY . .
|
27 |
|
28 |
-
#
|
29 |
-
|
30 |
|
31 |
-
#
|
32 |
CMD ["python", "app.py"]
|
|
|
1 |
+
# Use the base Python image
|
2 |
+
FROM docker.io/library/python:3.8@sha256:01a4da15f16395a2d17dd9b673ccedcd6a6dbb4e130c8056d0d804dedac11c81
|
3 |
|
4 |
+
# Set the working directory
|
5 |
WORKDIR /app
|
6 |
|
7 |
+
# Restore cache if available
|
8 |
+
RUN mkdir -p /tmp/nltk_data
|
|
|
9 |
|
10 |
+
# Set environment variable for NLTK data
|
11 |
+
ENV NLTK_DATA /tmp/nltk_data
|
12 |
|
13 |
+
# Install NLTK and dependencies
|
14 |
RUN pip install nltk
|
15 |
|
16 |
+
# Copy the requirements file
|
|
|
|
|
|
|
17 |
COPY requirements.txt requirements.txt
|
18 |
|
19 |
+
# Install Python dependencies
|
20 |
RUN pip install -r requirements.txt
|
21 |
|
22 |
+
# Copy the rest of the application code
|
23 |
COPY . .
|
24 |
|
25 |
+
# Set permissions for the /tmp/nltk_data directory
|
26 |
+
RUN chmod -R 777 /tmp/nltk_data
|
27 |
|
28 |
+
# Application startup command
|
29 |
CMD ["python", "app.py"]
|