Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +15 -30
Dockerfile
CHANGED
@@ -1,45 +1,30 @@
|
|
1 |
-
#
|
2 |
-
|
3 |
|
4 |
-
#
|
5 |
-
|
6 |
|
7 |
-
|
|
|
|
|
|
|
8 |
|
9 |
# Create and switch to a non-root user
|
10 |
RUN useradd -m -u 1000 user
|
11 |
USER user
|
12 |
ENV PATH="/home/user/.local/bin:$PATH"
|
13 |
|
14 |
-
# Set
|
15 |
-
WORKDIR /
|
16 |
|
17 |
-
#
|
18 |
-
USER root
|
19 |
-
RUN apt-get update && \
|
20 |
-
apt-get install -y wget git calibre ffmpeg libmecab-dev mecab mecab-ipadic && \
|
21 |
-
apt-get clean && \
|
22 |
-
rm -rf /var/lib/apt/lists/*
|
23 |
-
|
24 |
-
# Clone the GitHub repository and set it as the working directory
|
25 |
-
USER root
|
26 |
-
RUN apt-get update && apt-get install -y git && apt-get clean && rm -rf /var/lib/apt/lists/*
|
27 |
-
USER user
|
28 |
RUN git clone https://github.com/DrewThomasson/ebook2audiobook.git /home/user/ebook2audiobook
|
29 |
|
30 |
-
#
|
31 |
-
WORKDIR /home/user/ebook2audiobook
|
32 |
-
|
33 |
-
#Install Python dependences from the ebook2audiobook repo
|
34 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
35 |
|
36 |
-
#
|
37 |
-
# RUN echo "This is a test sentence." > test.txt
|
38 |
-
# RUN python app.py --headless --ebook test.txt
|
39 |
-
# RUN rm test.txt
|
40 |
-
|
41 |
-
# Expose the required port
|
42 |
EXPOSE 7860
|
43 |
|
44 |
-
# Start the Gradio app
|
45 |
-
CMD ["python", "app.py"]
|
|
|
1 |
+
# Use an official Python image
|
2 |
+
FROM nvidia/cuda:11.8.0-base-ubuntu22.04
|
3 |
|
4 |
+
# Set up Python environment
|
5 |
+
ENV PYTHONUNBUFFERED=1
|
6 |
|
7 |
+
# Install system packages
|
8 |
+
RUN apt-get update && apt-get install -y \
|
9 |
+
wget git calibre ffmpeg libmecab-dev mecab mecab-ipadic python3-pip \
|
10 |
+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
11 |
|
12 |
# Create and switch to a non-root user
|
13 |
RUN useradd -m -u 1000 user
|
14 |
USER user
|
15 |
ENV PATH="/home/user/.local/bin:$PATH"
|
16 |
|
17 |
+
# Set working directory
|
18 |
+
WORKDIR /home/user/ebook2audiobook
|
19 |
|
20 |
+
# Clone the GitHub repository
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
RUN git clone https://github.com/DrewThomasson/ebook2audiobook.git /home/user/ebook2audiobook
|
22 |
|
23 |
+
# Install Python dependencies
|
|
|
|
|
|
|
24 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
25 |
|
26 |
+
# Expose the application port
|
|
|
|
|
|
|
|
|
|
|
27 |
EXPOSE 7860
|
28 |
|
29 |
+
# Start the Gradio app
|
30 |
+
CMD ["python", "app.py"]
|