Spaces:
Sleeping
Sleeping
File size: 1,093 Bytes
7bb114a e21ad63 7bb114a e21ad63 7bb114a e21ad63 7bb114a e21ad63 7bb114a e21ad63 | 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 | FROM python:3.9-slim
# Set environment variables to avoid interactive prompts
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Istanbul
WORKDIR /app
# Install system dependencies without interactive prompts
RUN apt-get update && apt-get install -y \
git \
tzdata \
libgl1-mesa-glx \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender-dev \
libgomp1 \
wget \
&& ln -fs /usr/share/zoneinfo/$TZ /etc/localtime \
&& echo $TZ > /etc/timezone \
&& dpkg-reconfigure --frontend noninteractive tzdata \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first (for better 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 code
COPY . .
# Create user for HuggingFace Spaces
RUN useradd -m -u 1000 user
USER user
# Expose port for Streamlit
EXPOSE 7860
# Run the application with proper streamlit command
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0", "--server.headless=true"] |