prompt-search-engine / Dockerfile
supertskone's picture
Update Dockerfile
52c3612 verified
raw
history blame
1.01 kB
# Use an official Python runtime as a parent image
FROM python:3.12-slim
### Set up user with permissions
# Set up a new user named "user" with user ID 1000
RUN useradd -m -u 1000 user
# Switch to the "user" user
USER user
# 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"]