Spaces:
Running
Running
FROM python:3.11 | |
# Create a non-root user | |
RUN useradd -m -u 1000 user | |
RUN chown -R user:user $HOME | |
USER user | |
# Set environment variables | |
ENV HOME=/home/user | |
ENV PATH=$HOME/.local/bin:$PATH | |
ENV NLTK_DATA=$HOME/nltk_data | |
ENV PYTHONUSERBASE=$HOME/.local | |
WORKDIR $HOME | |
RUN mkdir -p app | |
RUN mkdir -p $NLTK_DATA | |
# Install dependencies | |
COPY ./requirements.txt $HOME/app/requirements.txt | |
RUN pip3 install --no-cache-dir -r $HOME/app/requirements.txt | |
COPY . $HOME/app | |
RUN python3 -c "import nltk; nltk.download('stopwords', download_dir='$NLTK_DATA')" | |
EXPOSE 8501 | |
WORKDIR $HOME/app | |
CMD streamlit run app.py \ | |
--server.headless true \ | |
--server.enableCORS false \ | |
--server.enableXsrfProtection false \ | |
--server.fileWatcherType none |