A7med4 commited on
Commit
d1dd05a
1 Parent(s): eb3cfd5

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -17
Dockerfile CHANGED
@@ -1,32 +1,29 @@
1
- FROM python:3.8
 
2
 
3
- # Set working directory
4
  WORKDIR /app
5
 
6
- # Set environment variables
7
- ENV TRANSFORMERS_CACHE="/tmp/transformers_cache"
8
- ENV NLTK_DATA="/tmp/nltk_data"
9
 
10
- # Create NLTK data directory
11
- RUN mkdir -p $NLTK_DATA
12
 
13
- # Install NLTK
14
  RUN pip install nltk
15
 
16
- # Install NLTK data
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
- # Expose port 5000
29
- EXPOSE 5000
30
 
31
- # Run the application
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"]