drewThomasson commited on
Commit
da551e8
·
verified ·
1 Parent(s): a6c9d23

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -3
Dockerfile CHANGED
@@ -1,12 +1,14 @@
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.9
5
 
 
6
  RUN useradd -m -u 1000 user
7
  USER user
8
  ENV PATH="/home/user/.local/bin:$PATH"
9
 
 
10
  WORKDIR /app
11
 
12
  # Install system packages from packages.txt
@@ -15,12 +17,21 @@ USER root
15
  RUN apt-get update && xargs -a packages.txt apt-get install -y && apt-get clean && rm -rf /var/lib/apt/lists/*
16
  USER user
17
 
 
18
  COPY --chown=user ./requirements.txt requirements.txt
19
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
20
 
21
- COPY --chown=user . /app
 
 
 
 
 
 
 
22
 
 
23
  EXPOSE 7860
24
 
25
- # Start the Gradio app
26
  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
+ FROM python:3.10
5
 
6
+ # Create and switch to a non-root user
7
  RUN useradd -m -u 1000 user
8
  USER user
9
  ENV PATH="/home/user/.local/bin:$PATH"
10
 
11
+ # Set a working directory for temporary operations
12
  WORKDIR /app
13
 
14
  # Install system packages from packages.txt
 
17
  RUN apt-get update && xargs -a packages.txt apt-get install -y && apt-get clean && rm -rf /var/lib/apt/lists/*
18
  USER user
19
 
20
+ # Install Python dependencies
21
  COPY --chown=user ./requirements.txt requirements.txt
22
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
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
+ # Set the cloned repository as the base working directory
31
+ WORKDIR /home/user/ebook2audiobook
32
 
33
+ # Expose the required port
34
  EXPOSE 7860
35
 
36
+ # Start the Gradio app from the repository
37
  CMD ["python", "app.py"]