# Use a base image with Debian and necessary dependencies FROM debian:buster-slim # Set non-interactive mode during apt-get installs ENV DEBIAN_FRONTEND=noninteractive # Step 1: Update and upgrade the system RUN apt-get update && apt-get upgrade -y # Step 2: Install dependencies RUN apt-get install -y --no-install-recommends \ git \ git-lfs \ wget \ curl \ build-essential \ libssl-dev \ zlib1g-dev \ libbz2-dev \ libreadline-dev \ libsqlite3-dev \ libncursesw5-dev \ xz-utils \ tk-dev \ libxml2-dev \ libxmlsec1-dev \ libffi-dev \ liblzma-dev \ ffmpeg \ libsndfile-dev \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* # Step 3: Clone the repo RUN git -c http.sslVerify=false clone https://github.com/Audio-AGI/WavJourney.git # Step 4: Install miniconda RUN apt-get update && apt-get install -y wget && rm -rf /var/lib/apt/lists/* RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \ && bash Miniconda3-latest-Linux-x86_64.sh -b -p /opt/miniconda3 \ && rm -f Miniconda3-latest-Linux-x86_64.sh # Step 5: Add conda binary to PATH variable ENV HOME=/home/user \ PATH=/opt/miniconda3/bin:/home/user/.local/bin:$PATH \ CONDA_PREFIX=/opt/miniconda3/envs # Step 6: Setup conda envs WORKDIR $HOME/app COPY --chown=user . $HOME/app # Step 7: Conda envs setup RUN bash ./scripts/EnvsSetup.sh # Step 8: Pre-download all models RUN conda run --live-stream -n WavJourney python scripts/download_models.py RUN mkdir $HOME/app/services_logs # Step 9: Env settings ENV PYTHONPATH=${HOME}/app \ PYTHONUNBUFFERED=1 \ GRADIO_ALLOW_FLAGGING=never \ GRADIO_NUM_PORTS=1 \ GRADIO_SERVER_NAME=0.0.0.0 \ GRADIO_THEME=huggingface \ SYSTEM=spaces # Step 10: Start the service entrypoint ENTRYPOINT bash /home/user/app/scripts/start_services.sh