-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
90 lines (79 loc) · 1.93 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Use a slim version of Python runtime as a parent image
FROM python:3.10.13
# Prevent Python from writing .pyc files and buffering stdout/stderr
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# Install necessary system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
ffmpeg \
libsndfile1 \
git \
wget \
libegl1 \
libgl1 \
libgl1-mesa-glx \
libopengl0 \
libxcb-cursor0 \
libxcb-shape0 \
libxcb-randr0 \
libxcb-render0 \
libxcb-render-util0 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-glx0 \
libxkbcommon0 \
libxkbcommon-x11-0 \
libx11-xcb1 \
libxrender1 \
libxfixes3 \
libxdamage1 \
libxext6 \
libsm6 \
libx11-6 \
libxft2 \
libxinerama1 \
libxrandr2 \
libxcomposite1 \
libxcursor1 \
libxi6 \
libfontconfig1 \
libfreetype6 \
libssl3 \
libxml2 \
libxslt1.1 \
libsqlite3-0 \
zlib1g \
libopenjp2-7 \
libjpeg62-turbo \
libpng16-16 \
libtiff-dev \
libwebp7 \
poppler-utils \
libxml2-dev \
libxslt1-dev \
libgtk-3-0 \
libglib2.0-0 \
libglib2.0-data \
libice6 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install Calibre (which includes ebook-convert)
RUN wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sh /dev/stdin
# Ensure that ebook-convert is available in PATH
ENV PATH="/root/calibre:${PATH}"
# Set working directory
WORKDIR /app
# Create necessary directories
RUN mkdir -p /app/Working_files/Book /app/Working_files/temp_ebook /app/Working_files/temp
# Copy the requirements file
COPY requirements.txt .
# Install Python dependencies
RUN pip install --upgrade pip
RUN pip install --no-cache-dir --verbose -r requirements.txt
# Download NLTK data
RUN python -m nltk.downloader punkt
# Copy your application files
COPY app.py .
# **Set ENTRYPOINT and CMD**
ENTRYPOINT ["python", "app.py"]
CMD []