sanketshinde3001 commited on
Commit
b281f29
·
verified ·
1 Parent(s): b04beef

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +32 -0
Dockerfile ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use a minimal Python image
2
+ FROM python:3.9-slim
3
+
4
+ # Set the working directory
5
+
6
+ RUN useradd -m -u 1000 user
7
+ WORKDIR /app
8
+
9
+ # Copy dependencies and install them
10
+ COPY --chown=user ./requirements.txt requirements.txt
11
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
12
+
13
+ # Copy the application files
14
+ COPY . .
15
+
16
+ # Download necessary NLTK data
17
+ RUN python -c "import nltk; nltk.download('vader_lexicon'); nltk.download('punkt'); nltk.download('stopwords')"
18
+
19
+ COPY --chown=user . /app
20
+
21
+ USER user
22
+
23
+ ENV HOME=/home/user \
24
+ PATH=/home/user/.local/bin:$PATH
25
+
26
+ # Expose the required port
27
+ EXPOSE 7860
28
+
29
+ # Run FastAPI
30
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
31
+
32
+