MemMachine-Playground / Dockerfile
AnirudhEsthuri-MV's picture
Update Dockerfile
98b6550
raw
history blame
1.22 kB
FROM python:3.12-slim
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
git \
curl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Upgrade pip
RUN pip install --upgrade pip
# Copy requirements first for better caching
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy all application files
COPY app.py .
COPY gateway_client.py .
COPY llm.py .
COPY model_config.py .
COPY styles.css .
# Copy assets directory
COPY assets/ ./assets/
# Copy Streamlit configuration
COPY .streamlit/ .streamlit/
# Set environment variables for Streamlit
ENV STREAMLIT_SERVER_PORT=7860
ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
ENV STREAMLIT_SERVER_HEADLESS=true
ENV STREAMLIT_BROWSER_GATHER_USAGE_STATS=false
# Expose port 7860 (required for Hugging Face Spaces)
EXPOSE 7860
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD curl --fail http://localhost:7860/_stcore/health || exit 1
# Run Streamlit app
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0", "--server.headless=true"]