omni-docker / Dockerfile
victor's picture
victor HF Staff
feat: Update Dockerfile and requirements.txt to resolve PyAudio build issues
9616027
# Use an official Python runtime as a parent image
FROM python:3.10-slim
# Set the working directory in the container
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
ffmpeg \
&& rm -rf /var/lib/apt/lists/*
# Copy the current directory contents into the container at /app
COPY . /app
# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Make port 7860 available to the world outside this container
EXPOSE 7860
# Set environment variable for API_URL
ENV API_URL=http://0.0.0.0:7860/chat
# Set PYTHONPATH
ENV PYTHONPATH=./
# Set environment variables
ENV MPLCONFIGDIR=/tmp/matplotlib
ENV HF_HOME=/data/huggingface
ENV XDG_CACHE_HOME=/data/cache
# Create a volume for data
VOLUME /data
# Set permissions for the /data directory and create necessary subdirectories
RUN mkdir -p /data/checkpoint /data/cache /data/huggingface && \
chown -R 1000:1000 /data && \
chmod -R 777 /data
# Install Flask
RUN pip install flask
# Copy the HTML demo file
COPY webui/omni_html_demo.html .
# Run the Flask app to serve the HTML demo
CMD ["python", "serve_html.py"]