chromadata / Dockerfile
vish85521's picture
Create Dockerfile
db5371c verified
raw
history blame contribute delete
822 Bytes
# Use an official lightweight Python image
FROM python:3.10-slim
# Hugging Face Spaces require running as a non-root user
RUN useradd -m -u 1000 user
USER user
# Set environment variables for the user and ChromaDB config
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH \
CHROMA_HOST=vish85521-chromadb.hf.space \
CHROMA_PORT=443 \
CHROMA_SSL=True
# Set the working directory
WORKDIR $HOME/app
# Copy the requirements file and install dependencies
COPY --chown=user requirements.txt $HOME/app/
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application code
COPY --chown=user . $HOME/app
# Expose the default port for Hugging Face Spaces
EXPOSE 7860
# Run the Streamlit application
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]