File size: 1,082 Bytes
60c7bb2
 
c67c5df
 
9c56103
60c7bb2
 
922750a
60c7bb2
dc472b0
c67c5df
 
 
 
 
 
 
dc472b0
9e59b82
60c7bb2
9c56103
c67c5df
 
60c7bb2
87705c7
60c7bb2
87705c7
60c7bb2
dc472b0
60c7bb2
c67c5df
9c56103
dc472b0
dfcbfef
 
7899208
9c56103
c67c5df
 
9c56103
9e59b82
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
FROM python:3.13-slim

WORKDIR /app

# Environment variables
ENV HOME=/app
ENV XDG_CONFIG_HOME=/app/.streamlit
ENV NLTK_DATA=/app/nltk_data

# Install system dependencies
RUN apt-get update && apt-get install -y \
    build-essential \
    curl \
    software-properties-common \
    git \
    && rm -rf /var/lib/apt/lists/*

# Create necessary directories
RUN mkdir -p /app/.streamlit /app/nltk_data && chmod -R 777 /app

# Copy files
COPY requirements.txt ./
COPY src/ ./src/
COPY src/c_d.csv ./src/
COPY src/logistic_models.pkl ./src/
COPY src/tfidf.pkl ./src/
COPY src/multilabels.pkl ./src/

# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt

# 👇 Run NLTK downloads only after nltk is installed
RUN python -m nltk.downloader -d /app/nltk_data punkt averaged_perceptron_tagger wordnet stopwords
RUN python -m nltk.downloader -d /app/nltk_data punkt punkt_tab averaged_perceptron_tagger wordnet stopwords


# Expose port
EXPOSE 8501

# Start app
CMD ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]