mirror of
https://github.com/ajurna/cbwebreader.git
synced 2025-12-06 06:17:17 +00:00
Docker compress (#31)
* update to Dockerfile to make the build much smaller. * update to Dockerfile to make the build much smaller. * update to Dockerfile to make the build much smaller. * update to Dockerfile to make the build much smaller. * update to Dockerfile to make the build much smaller. * update to Dockerfile to make the build much smaller. * update to Dockerfile to make the build much smaller. * update to Dockerfile to make the build much smaller. * update to Dockerfile to make the build much smaller. * update to Dockerfile to make the build much smaller. * update to Dockerfile to make the build much smaller. * update to Dockerfile to make the build much smaller. * update to Dockerfile to make the build much smaller. * update to Dockerfile to make the build much smaller. * update to Dockerfile to make the build much smaller. * update to Dockerfile to make the build much smaller. * update to Dockerfile to make the build much smaller. * update to Dockerfile to make the build much smaller. * update to Dockerfile to make the build much smaller. * update to Dockerfile to make the build much smaller. * update to Dockerfile to make the build much smaller. * update to Dockerfile to make the build much smaller. * update to Dockerfile to make the build much smaller. * update to Dockerfile to make the build much smaller. * update to Dockerfile to make the build much smaller.
This commit is contained in:
29
Dockerfile
29
Dockerfile
@@ -15,31 +15,24 @@ ENV PIP_DEFAULT_TIMEOUT=100 \
|
||||
PIP_NO_CACHE_DIR=1
|
||||
|
||||
RUN apk update
|
||||
RUN apk add --no-cache tini bash unrar dcron postgresql-dev gcc python3-dev musl-dev libffi-dev jpeg-dev
|
||||
|
||||
RUN apk add --no-cache --virtual .build-deps mariadb-dev build-base \
|
||||
&& apk add --virtual .runtime-deps mariadb-connector-c-dev mariadb-connector-c
|
||||
|
||||
RUN apk add gcc g++ cmake make mupdf-dev freetype-dev
|
||||
ARG MUPDF=1.18.0
|
||||
RUN ln -s /usr/include/freetype2/ft2build.h /usr/include/ft2build.h \
|
||||
|
||||
COPY requirements.txt /src
|
||||
|
||||
RUN apk add --no-cache --virtual .build-deps gcc build-base g++ cmake make postgresql-dev mariadb-dev mariadb-connector-c-dev musl-dev mupdf-dev python3-dev freetype-dev libffi-dev \
|
||||
&& apk add --no-cache tini bash unrar dcron python3 mariadb-connector-c jpeg-dev postgresql-libs \
|
||||
&& ln -s /usr/include/freetype2/ft2build.h /usr/include/ft2build.h \
|
||||
&& ln -s /usr/include/freetype2/freetype/ /usr/include/freetype \
|
||||
&& wget -c -q https://www.mupdf.com/downloads/archive/mupdf-${MUPDF}-source.tar.gz \
|
||||
&& tar xf mupdf-${MUPDF}-source.tar.gz \
|
||||
&& cd mupdf-${MUPDF}-source \
|
||||
&& make HAVE_X11=no HAVE_GLUT=no shared=yes prefix=/usr/local install \
|
||||
&& cd .. \
|
||||
&& rm -rf *.tar.gz mupdf-${MUPDF}-source
|
||||
|
||||
RUN pip install --upgrade pip
|
||||
|
||||
RUN pip install PyMuPDF==1.18.12
|
||||
|
||||
COPY requirements.txt /src
|
||||
|
||||
RUN pip install -r requirements.txt
|
||||
|
||||
RUN apk del .build-deps
|
||||
&& rm -rf *.tar.gz mupdf-${MUPDF}-source \
|
||||
&& pip install --upgrade pip \
|
||||
&& pip install -r requirements.txt \
|
||||
&& apk del .build-deps
|
||||
|
||||
ADD https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh /src
|
||||
|
||||
@@ -50,5 +43,3 @@ COPY . /src/
|
||||
RUN cat /src/cbreader/crontab >> /etc/crontabs/root
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
|
||||
|
||||
@@ -351,7 +351,7 @@ class ComicBook(models.Model):
|
||||
book.verify_pages()
|
||||
elif archive_type == 'pdf':
|
||||
with atomic():
|
||||
for page_index in range(archive.getNumPages()):
|
||||
for page_index in range(archive.page_count):
|
||||
page = ComicPage(
|
||||
Comic=book, index=page_index, page_file_name=page_index+1, content_type='application/pdf'
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user