Spaces:
Sleeping
Sleeping
File size: 1,173 Bytes
875bcff 9616027 875bcff 9616027 875bcff 9616027 5f34e64 9616027 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# 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"]
|