Files
shelfmark/Dockerfile
T
CaliBrainandmik593 3a92c5de78 CF BYPASS (#24)
The Calibre dependency was due to the script testing for validity of the
downloaded file, as often they would be corrupted from aa. But CWA is
already doing that, so we are just having redundant code here.

For the cloudflarebypasser, I basically run my own version now, instead
of depending on an external library, this way we have better control for
debugging and on the docker image.

Fixes #18, #33, #27, #48, #65, #78, #86, #88, #89

---------

Co-authored-by: mik593 <91991279+mik593@users.noreply.github.com>
2025-03-16 02:25:15 -04:00

49 lines
1.3 KiB
Docker

FROM python:3.12-slim
ENV DEBIAN_FRONTEND=noninteractive \
DOCKERMODE=true \
PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
PIP_DEFAULT_TIMEOUT=100 \
NAME=Calibre-Web-Automated-Book-Downloader \
FLASK_HOST=0.0.0.0 \
FLASK_PORT=8084 \
FLASK_DEBUG=0 \
STATUS_TIMEOUT=3600 \
PYTHONPATH=/app \
USE_CF_BYPASS=true \
AA_BASE_URL=https://annas-archive.org \
UID=1000 \
GID=100
# Install minimal dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends --no-install-suggests \
curl \
xvfb \
chromium-driver \
dumb-init && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Install Python dependencies including playwright
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt && \
rm -rf /root/.cache /app/.cache
COPY . .
RUN chmod +x /app/entrypoint.sh && \
# Create necessary directories
mkdir -p /var/log/cwa-book-downloader && \
mkdir -p /cwa-book-ingest
EXPOSE ${FLASK_PORT}
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
CMD curl -f http://localhost:${FLASK_PORT}/request/api/status || exit 1
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["/app/entrypoint.sh"]