-
-
Notifications
You must be signed in to change notification settings - Fork 603
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #264 from ROBERT-MCDOWELL/v25
Release v25.2.0
- Loading branch information
Showing
56 changed files
with
4,925 additions
and
4,337 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,57 @@ | ||
# Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker | ||
# you will also find guides on how best to write your Dockerfile | ||
|
||
# Build with the command: | ||
# docker build --platform linux/amd64 -t ebook2audiobook . | ||
|
||
FROM python:3.12 | ||
|
||
# Create and switch to a non-root user | ||
RUN useradd -m -u 1000 user | ||
USER user | ||
ENV PATH="/home/user/.local/bin:$PATH" | ||
|
||
# Set a working directory for temporary operations | ||
WORKDIR /app | ||
|
||
# Install system packages | ||
USER root | ||
RUN apt-get update && \ | ||
apt-get install -y wget git calibre ffmpeg libmecab-dev mecab mecab-ipadic && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Clone the GitHub repository and set it as the working directory | ||
USER root | ||
RUN apt-get update && apt-get install -y git && apt-get clean && rm -rf /var/lib/apt/lists/* | ||
USER user | ||
RUN git clone https://github.com/DrewThomasson/ebook2audiobook.git /home/user/app | ||
|
||
# Set the cloned repository as the base working directory | ||
WORKDIR /home/user/app | ||
|
||
#Install Python dependences from the ebook2audiobook repo | ||
RUN pip install --no-cache-dir --upgrade -r requirements.txt | ||
|
||
# Do a test run to make sure that the base models are pre-downloaded and baked into the image | ||
# RUN echo "This is a test sentence." > test.txt | ||
# RUN python app.py --headless --ebook test.txt | ||
# RUN rm test.txt | ||
|
||
# Expose the required port | ||
EXPOSE 7860 | ||
|
||
# Start the Gradio app from the repository | ||
CMD ["python", "app.py"] | ||
# Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker | ||
# you will also find guides on how best to write your Dockerfile | ||
|
||
# Build with the command: | ||
# docker build --platform linux/amd64 -t athomasson2/ebook2audiobook:dev_2.1_small . | ||
|
||
FROM python:3.12 | ||
|
||
# Create and switch to a non-root user | ||
RUN useradd -m -u 1000 user | ||
USER user | ||
ENV PATH="/home/user/.local/bin:$PATH" | ||
|
||
# Set a working directory for temporary operations | ||
WORKDIR /app | ||
|
||
# Install system packages | ||
USER root | ||
RUN apt-get update && \ | ||
apt-get install -y wget git calibre ffmpeg libmecab-dev mecab mecab-ipadic-utf8 curl && \ | ||
curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \ | ||
apt-get install -y nodejs && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
|
||
|
||
# Clone the GitHub repository and set it as the working directory | ||
USER root | ||
RUN apt-get update && apt-get install -y git && apt-get clean && rm -rf /var/lib/apt/lists/* | ||
USER user | ||
RUN git clone https://github.com/DrewThomasson/ebook2audiobook.git /home/user/app | ||
|
||
# Set the cloned repository as the base working directory | ||
WORKDIR /home/user/app | ||
|
||
# Install Python dependencies | ||
# Install UniDic and its dependencies | ||
RUN pip install --no-cache-dir unidic-lite unidic | ||
RUN python3 -m unidic download # Download UniDic | ||
RUN mkdir -p /home/user/.local/share/unidic && \ | ||
mv ~/.local/share/unidic/* /home/user/.local/share/unidic/ || true | ||
RUN pip install --no-cache-dir --upgrade -r requirements.txt | ||
|
||
# Set environment variable to ensure MeCab can locate UniDic | ||
ENV UNIDIC_DIR=/home/user/.local/share/unidic | ||
|
||
# Do a test run to make sure that the base models are pre-downloaded and baked into the image | ||
#RUN echo "This is a test sentence." > test.txt | ||
#RUN python app.py --headless --ebook test.txt --script_mode full_docker | ||
#RUN rm test.txt | ||
|
||
# Expose the required port | ||
EXPOSE 7860 | ||
|
||
# Start the Gradio app with the required flag | ||
CMD ["python", "app.py", "--script_mode", "full_docker"] |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.