testchatbot / Dockerfile
mujeebanwar's picture
Upload 7 files
8602315 verified
Raw History Blame Contribute Delete
1.21 kB
# Dockerfile (Final Definitive Version)
# Start with a standard Python 3.10 image
FROM python:3.10-slim
WORKDIR /app
# Ensure HOME is set so git --global writes to /root/.gitconfig (HF build step)
ENV HOME=/root
RUN apt-get update && \
apt-get install -y --no-install-recommends \
supervisor \
wget \
build-essential \
git \
&& apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Upgrade pip and install wheel to speed up package installations
RUN pip install --no-cache-dir --upgrade pip wheel setuptools
# Copy and install all Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of your application code
COPY . .
# Ensure Chroma data directory exists and is writable
RUN mkdir -p /data/chroma_db_store && chmod -R 777 /data
# Copy your supervisor configuration
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Set default port (HF injects PORT env)
ENV PORT=7860
# Hugging Face Spaces expose port 7860 by default
EXPOSE 7860
# The final command to run when the container starts
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]