Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +11 -6
Dockerfile
CHANGED
@@ -1,25 +1,30 @@
|
|
1 |
-
# Use an official Python image
|
2 |
FROM nvidia/cuda:11.8.0-base-ubuntu22.04
|
3 |
|
4 |
-
# Set
|
5 |
ENV DEBIAN_FRONTEND=noninteractive
|
6 |
ENV PYTHONUNBUFFERED=1
|
7 |
|
8 |
# Install system packages
|
9 |
RUN apt-get update && apt-get install -y \
|
10 |
-
wget git calibre ffmpeg libmecab-dev mecab mecab-ipadic python3-pip \
|
|
|
|
|
11 |
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
12 |
|
|
|
|
|
|
|
13 |
# Create and switch to a non-root user
|
14 |
RUN useradd -m -u 1000 user
|
15 |
USER user
|
16 |
ENV PATH="/home/user/.local/bin:$PATH"
|
17 |
|
18 |
# Set working directory
|
19 |
-
WORKDIR /home/user/
|
20 |
|
21 |
# Clone the GitHub repository
|
22 |
-
RUN git clone https://github.com/DrewThomasson/ebook2audiobook.git /home/user/
|
23 |
|
24 |
# Install Python dependencies
|
25 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
@@ -28,4 +33,4 @@ RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
|
28 |
EXPOSE 7860
|
29 |
|
30 |
# Start the Gradio app
|
31 |
-
CMD ["
|
|
|
1 |
+
# Use an official Python image with NVIDIA support
|
2 |
FROM nvidia/cuda:11.8.0-base-ubuntu22.04
|
3 |
|
4 |
+
# Set environment variables for non-interactive mode
|
5 |
ENV DEBIAN_FRONTEND=noninteractive
|
6 |
ENV PYTHONUNBUFFERED=1
|
7 |
|
8 |
# Install system packages
|
9 |
RUN apt-get update && apt-get install -y \
|
10 |
+
wget git calibre ffmpeg libmecab-dev mecab mecab-ipadic python3-pip software-properties-common \
|
11 |
+
&& add-apt-repository -y ppa:deadsnakes/ppa \
|
12 |
+
&& apt-get install -y python3.12 python3.12-venv python3.12-distutils \
|
13 |
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
14 |
|
15 |
+
# Update alternatives to use Python 3.12
|
16 |
+
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1
|
17 |
+
|
18 |
# Create and switch to a non-root user
|
19 |
RUN useradd -m -u 1000 user
|
20 |
USER user
|
21 |
ENV PATH="/home/user/.local/bin:$PATH"
|
22 |
|
23 |
# Set working directory
|
24 |
+
WORKDIR /home/user/ebook2audiobook
|
25 |
|
26 |
# Clone the GitHub repository
|
27 |
+
RUN git clone https://github.com/DrewThomasson/ebook2audiobook.git /home/user/ebook2audiobook
|
28 |
|
29 |
# Install Python dependencies
|
30 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
|
|
33 |
EXPOSE 7860
|
34 |
|
35 |
# Start the Gradio app
|
36 |
+
CMD ["python3", "app.py"]
|