Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +9 -4
Dockerfile
CHANGED
@@ -1,6 +1,9 @@
|
|
1 |
# Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
|
2 |
# you will also find guides on how best to write your Dockerfile
|
3 |
|
|
|
|
|
|
|
4 |
FROM python:3.10
|
5 |
|
6 |
# Create and switch to a non-root user
|
@@ -24,17 +27,19 @@ RUN apt-get update && apt-get install -y git && apt-get clean && rm -rf /var/lib
|
|
24 |
USER user
|
25 |
RUN git clone https://github.com/DrewThomasson/ebook2audiobook.git /home/user/ebook2audiobook
|
26 |
|
27 |
-
|
28 |
# Set the cloned repository as the base working directory
|
29 |
WORKDIR /home/user/ebook2audiobook
|
30 |
-
RUN git checkout viet_bandaid
|
31 |
|
32 |
#Install Python dependences from the ebook2audiobook repo
|
33 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
34 |
|
|
|
|
|
|
|
|
|
|
|
35 |
# Expose the required port
|
36 |
EXPOSE 7860
|
37 |
|
38 |
# Start the Gradio app from the repository
|
39 |
-
CMD ["python", "app.py"]
|
40 |
-
|
|
|
1 |
# Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
|
2 |
# you will also find guides on how best to write your Dockerfile
|
3 |
|
4 |
+
# Build with the command:
|
5 |
+
# docker build --platform linux/amd64 -t ebook2audiobook .
|
6 |
+
|
7 |
FROM python:3.10
|
8 |
|
9 |
# Create and switch to a non-root user
|
|
|
27 |
USER user
|
28 |
RUN git clone https://github.com/DrewThomasson/ebook2audiobook.git /home/user/ebook2audiobook
|
29 |
|
|
|
30 |
# Set the cloned repository as the base working directory
|
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 |
+
# Do a test run to make sure that the base models are pre-downloaded and baked into the image
|
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 from the repository
|
45 |
+
CMD ["python", "app.py"]
|
|