testing / Dockerfile
samim2024's picture
Update Dockerfile
7a3ba0e verified
raw
history blame
906 Bytes
# Use official slim Python base image
FROM python:3.10-slim
# Environment settings
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
TRANSFORMERS_CACHE=/tmp/huggingface \
HF_HOME=/tmp/huggingface
# Create cache and working directories
RUN mkdir -p /tmp/huggingface /app/data /app/vectorstore
WORKDIR /app
# Install OS dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender-dev \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY . .
# Expose ports for Streamlit and FastAPI
EXPOSE 8501 8000
# Run both Streamlit and FastAPI
CMD ["sh", "-c", "streamlit run app.py & exec uvicorn api:app --host 0.0.0.0 --port 8000"]