arssite commited on
Commit
789cf3a
·
verified ·
1 Parent(s): aa2b6f4

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +34 -0
Dockerfile ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use Python 3.10 to match your previous logs
2
+ FROM python:3.10
3
+
4
+ # Set the working directory
5
+ WORKDIR /code
6
+
7
+ # Copy requirements first to cache dependencies
8
+ COPY ./requirements.txt /code/requirements.txt
9
+
10
+ # Install the CORRECT system libraries (libgl1 instead of the broken package)
11
+ RUN apt-get update && apt-get install -y \
12
+ ffmpeg \
13
+ libsm6 \
14
+ libxext6 \
15
+ libgl1 \
16
+ && rm -rf /var/lib/apt/lists/*
17
+
18
+ # Install Python dependencies
19
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
20
+
21
+ # Copy the rest of your app files
22
+ COPY . .
23
+
24
+ # create a user to avoid permission errors (Standard for HF Spaces)
25
+ RUN useradd -m -u 1000 user
26
+ USER user
27
+ ENV HOME=/home/user \
28
+ PATH=/home/user/.local/bin:$PATH
29
+
30
+ WORKDIR $HOME/app
31
+ COPY --chown=user . $HOME/app
32
+
33
+ # Run your specific script
34
+ CMD ["python", "SentimentAnalyzerUsingDistilbert.py"]