KanhaSays / Dockerfile
aryan083's picture
static added
c794bad
raw
history blame contribute delete
874 Bytes
FROM python:3.9-slim
WORKDIR /app
# Create nltk_data directory with proper permissions
RUN mkdir -p /usr/local/share/nltk_data && \
chmod -R 777 /usr/local/share/nltk_data
# Copy requirements first to leverage Docker cache
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Create directory structure and copy all static files
RUN mkdir -p /app/streamlit/static
COPY static/* /app/streamlit/static/
# Copy the rest of the application
COPY . .
# Download NLTK data to the correct location with proper permissions
RUN python -c "import nltk; nltk.data.path.append('/usr/local/share/nltk_data'); nltk.download('popular', download_dir='/usr/local/share/nltk_data')"
# Expose the port that Streamlit will use
EXPOSE 8501
# Run the Streamlit app
CMD ["streamlit", "run", "streamlit/main.py", "--server.address=0.0.0.0", "--server.port=8501"]