File size: 1,371 Bytes
193e526
 
36f6f17
193e526
36f6f17
 
 
 
 
 
 
 
 
 
193e526
36f6f17
 
193e526
36f6f17
 
 
193e526
 
36f6f17
 
 
 
 
193e526
 
 
36f6f17
193e526
 
36f6f17
193e526
 
 
36f6f17
193e526
 
36f6f17
 
 
 
193e526
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# 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"