superKartapi / Dockerfile
itsjarvis's picture
Upload Dockerfile with huggingface_hub
193e526 verified
# SuperKart Sales Forecasting Frontend - Docker Configuration
FROM python:3.10-slim
# Set environment variables for Python
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
curl \
gcc \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements file first for better Docker layer caching
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir -r requirements.txt
# Copy application files
COPY . .
# Create non-root user for security
RUN adduser --disabled-password --gecos '' streamlituser \
&& chown -R streamlituser:streamlituser /app
USER streamlituser
# Expose Streamlit port
EXPOSE 8501
# Health check for Streamlit
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8501/_stcore/health || exit 1
# Run Streamlit app
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.enableXsrfProtection=false", "--server.enableCORS=false"]
# Container metadata
LABEL maintainer="SuperKart ML Team"
LABEL version="1.0"
LABEL description="SuperKart Sales Forecasting Streamlit Frontend"