drewThomasson commited on
Commit
df9526d
·
verified ·
1 Parent(s): ba1e120

updated dockerfile test

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -3
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.12
5
 
6
  # Create and switch to a non-root user
@@ -22,16 +25,21 @@ RUN apt-get update && \
22
  USER root
23
  RUN apt-get update && apt-get install -y git && apt-get clean && rm -rf /var/lib/apt/lists/*
24
  USER user
25
- RUN git clone https://github.com/DrewThomasson/ebook2audiobook.git /home/user/ebook2audiobook
26
 
27
  # Set the cloned repository as the base working directory
28
- WORKDIR /home/user/ebook2audiobook
29
 
30
  #Install Python dependences from the ebook2audiobook repo
31
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
32
 
 
 
 
 
 
33
  # Expose the required port
34
  EXPOSE 7860
35
 
36
  # Start the Gradio app from the repository
37
- CMD ["python", "app.py"]
 
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.12
8
 
9
  # Create and switch to a non-root user
 
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/app
29
 
30
  # Set the cloned repository as the base working directory
31
+ WORKDIR /home/user/app
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"]