drewThomasson commited on
Commit
5716ff9
·
verified ·
1 Parent(s): 627fe4a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -3
Dockerfile CHANGED
@@ -5,11 +5,19 @@ FROM nvidia/cuda:11.8.0-base-ubuntu22.04
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
@@ -22,10 +30,10 @@ WORKDIR /home/user/app
22
  RUN git clone https://github.com/DrewThomasson/ebook2audiobook.git /home/user/app
23
 
24
  # Install Python dependencies
25
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
26
 
27
  # Expose the application port
28
  EXPOSE 7860
29
 
30
  # Start the Gradio app
31
- CMD ["python3", "app.py"]
 
5
  ENV DEBIAN_FRONTEND=noninteractive
6
  ENV PYTHONUNBUFFERED=1
7
 
8
+ # Install system packages and Python 3.12
9
  RUN apt-get update && apt-get install -y \
10
+ software-properties-common && \
11
+ add-apt-repository ppa:deadsnakes/ppa && \
12
+ apt-get update && apt-get install -y \
13
+ python3.12 python3.12-venv python3.12-dev \
14
  wget git calibre ffmpeg libmecab-dev mecab mecab-ipadic python3-pip \
15
  && apt-get clean && rm -rf /var/lib/apt/lists/*
16
 
17
+ # Make 'python' command work for Python 3.12
18
+ RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.12 1 && \
19
+ update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1
20
+
21
  # Create and switch to a non-root user
22
  RUN useradd -m -u 1000 user
23
  USER user
 
30
  RUN git clone https://github.com/DrewThomasson/ebook2audiobook.git /home/user/app
31
 
32
  # Install Python dependencies
33
+ RUN pip install --no-cache-dir --upgrade pip && pip install --no-cache-dir -r requirements.txt
34
 
35
  # Expose the application port
36
  EXPOSE 7860
37
 
38
  # Start the Gradio app
39
+ CMD ["python", "app.py"]