ai-visual-search / Dockerfile
sksameermujahid's picture
Upload 4 files
c58ab69 verified
raw
history blame contribute delete
995 Bytes
# Use Python 3.10 slim image
FROM python:3.10-slim
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
gcc \
g++ \
libgl1-mesa-glx \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender-dev \
libgomp1 \
&& rm -rf /var/lib/apt/lists/*
# Create necessary directories with proper permissions
RUN mkdir -p /tmp/huggingface_cache \
&& mkdir -p /tmp/property_images \
&& mkdir -p /tmp/uploads \
&& chmod -R 777 /tmp
# Copy requirements first for better caching
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy application files
COPY app.py .
COPY templates/ templates/
# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV PORT=7860
ENV TRANSFORMERS_CACHE=/tmp/huggingface_cache
ENV HF_HOME=/tmp/huggingface_cache
ENV XDG_CACHE_HOME=/tmp/huggingface_cache
# Expose port
EXPOSE 7860
# Run the application
CMD ["python", "app.py"]