# Use an official Python runtime as a parent image FROM python:3.9-slim RUN useradd -m -u 1000 user USER user ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH # Set the working directory in the container WORKDIR $HOME/src/app # Install any needed packages specified in requirements.txt COPY --chown=user requirements.txt ./ RUN pip install -r requirements.txt RUN huggingface-cli download sentence-transformers/all-mpnet-base-v2 \ --local-dir ./model/all-mpnet-base-v2 --local-dir-use-symlinks False # Copy the rest of your application's code COPY --chown=user ./src . # Make port 7860 available to the world outside this container EXPOSE 7860 # Run app.py when the container launches CMD ["python", "./app.py"]