prompt-search-engine / Dockerfile
supertskone's picture
Update Dockerfile
8c45fab verified
raw
history blame
861 Bytes
# Use an official Python runtime as a parent image
FROM python:3.12-slim
# Set the working directory
WORKDIR /app
# Copy the current directory contents into the container at /app
COPY . /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
# Set environment variable for Hugging Face cache
ENV TRANSFORMERS_CACHE=/app/cache
# Create the cache directory
RUN mkdir -p /app/cache/hub
RUN chmod -R 777 /app/cache
# Expose port 8501 for Streamlit and port 5000 for Flask
EXPOSE 8501
EXPOSE 5000
# Run data loading, backend, and frontend
CMD ["sh", "-c", "python load_data.py && python run.py & streamlit run ui/app.py --server.port=8501 --server.address=0.0.0.0"]