test2text / Dockerfile
Davide Panza
Update Dockerfile
5adda8d verified
raw
history blame
931 Bytes
FROM python:3.9-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
curl \
git \
&& rm -rf /var/lib/apt/lists/*
# Create directories
RUN mkdir -p /app/.streamlit /app/.cache
# Set cache environment variables
ENV TRANSFORMERS_CACHE=/app/.cache
ENV HF_HOME=/app/.cache
# Copy files
COPY .streamlit/ .streamlit/
COPY app/ ./
COPY chromadb_model/ chromadb_model/
COPY requirements.txt ./
# Install Python dependencies
RUN pip3 install -r requirements.txt
# Download NLTK data
RUN python -c "import nltk; nltk.download('punkt'); nltk.download('punkt_tab')"
# Streamlit configuration
ENV STREAMLIT_CONFIG_DIR=/app/.streamlit
ENV STREAMLIT_SERVER_HEADLESS=true
ENV STREAMLIT_BROWSER_GATHER_USAGE_STATS=false
EXPOSE 8501
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
ENTRYPOINT ["streamlit", "run", "main.py", "--server.address=0.0.0.0"]