uxoxo/eb2ab
0
1# Use an official CUDA base image2FROM nvidia/cuda:11.8.0-base-ubuntu22.043 4# Set up environment variables5ENV DEBIAN_FRONTEND=noninteractive6ENV PYTHONUNBUFFERED=17ENV PATH="/opt/conda/bin:$PATH"8 9# Install system packages and Miniconda10RUN apt-get update && apt-get install -y \11 wget git calibre ffmpeg libmecab-dev mecab mecab-ipadic \12 && apt-get clean && rm -rf /var/lib/apt/lists/* && \13 wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh && \14 bash miniconda.sh -b -p /opt/conda && \15 rm miniconda.sh && \16 /opt/conda/bin/conda clean --all --yes17 18# Create and activate the Python 3.12 environment19RUN conda create -y -n py312 python=3.12 && \20 conda clean -a21 22# Create and switch to a non-root user23RUN useradd -m -u 1000 user24USER user25 26# Activate the Conda environment27SHELL ["conda", "run", "-n", "py312", "/bin/bash", "-c"]28 29# Clone the GitHub repository30RUN git clone https://github.com/DrewThomasson/ebook2audiobook.git /home/user/app31 32# Set the working directory33WORKDIR /home/user/app34 35# Install Python dependencies using requirements.txt36RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \37 pip install --no-cache-dir -r requirements.txt38 39# Expose the application port40EXPOSE 786041 42# Start the Gradio app43CMD ["conda", "run", "-n", "py312", "python", "app.py"]