2025-12-12 00:19:24 +05:30
|
|
|
# Global variable declaration:
|
|
|
|
|
# Build to serve under Subdirectory BASE_URL if provided, eg: "ARG BASE_URL=/pdf/", otherwise leave blank: "ARG BASE_URL="
|
2025-12-09 14:02:40 +01:00
|
|
|
ARG BASE_URL=
|
|
|
|
|
|
2025-10-12 18:23:13 +05:30
|
|
|
# Build stage
|
2026-01-27 19:19:28 +05:30
|
|
|
FROM public.ecr.aws/docker/library/node:20-alpine AS builder
|
2025-10-12 18:23:13 +05:30
|
|
|
WORKDIR /app
|
|
|
|
|
COPY package*.json ./
|
2025-12-14 19:02:53 -05:00
|
|
|
COPY vendor ./vendor
|
2026-01-05 19:40:36 +05:30
|
|
|
ENV HUSKY=0
|
chore(docker,docs): improve npm reliability and update feature documentation
- Configure npm fetch retries and timeouts in Dockerfile to handle network issues during dependency installation
- Set fetch-retries to 5, fetch-retry-mintimeout to 60s, fetch-retry-maxtimeout to 300s, and fetch-timeout to 600s
- Update README.md feature descriptions for improved clarity and accuracy
- Add bookmark preservation notes to Merge PDFs and Alternate & Mix Pages tools
- Add new features: Rotate by Custom Degrees, PDF Booklet, PDF Form Filler, Deskew PDF, and Font to Outline
- Enhance PDF Editor description with specific capabilities (annotate, highlight, redact, comment, shapes, images, search)
- Reorganize feature table entries for better logical grouping
- Remove duplicate "Fill Forms" entry in favor of new PDF Form Filler tool
2026-01-14 22:20:41 +05:30
|
|
|
RUN npm config set fetch-retries 5 && \
|
|
|
|
|
npm config set fetch-retry-mintimeout 60000 && \
|
|
|
|
|
npm config set fetch-retry-maxtimeout 300000 && \
|
|
|
|
|
npm config set fetch-timeout 600000 && \
|
|
|
|
|
npm ci
|
2025-10-12 18:23:13 +05:30
|
|
|
COPY . .
|
|
|
|
|
|
|
|
|
|
# Build without type checking (vite build only)
|
2025-10-20 01:42:50 -07:00
|
|
|
# Pass SIMPLE_MODE environment variable if provided
|
2025-12-12 00:19:24 +05:30
|
|
|
ARG SIMPLE_MODE=false
|
2025-10-20 01:42:50 -07:00
|
|
|
ENV SIMPLE_MODE=$SIMPLE_MODE
|
feat: Add VitePress docs, EPUB to PDF tool, Phosphor icons, and licensing updates
- Set up VitePress documentation site (docs:dev, docs:build, docs:preview)
- Added Getting Started, Tools Reference, Contributing, and Commercial License pages
- Created self-hosting guides for Docker, Vercel, Netlify, Cloudflare, AWS, Hostinger, Nginx, Apache
- Updated README with documentation link, sponsors section, and docs contribution guide
- Added EPUB to PDF converter using LibreOffice WASM
- Migrated to Phosphor Icons for consistent iconography
- Added donation ribbon banner on landing page
- Removed 'Like My Work?' section (replaced by ribbon)
- Updated licensing.html with delivery model, AGPL notice, invoicing, and no-refund policy
- Added Commercial License documentation page
- Updated translations table (Chinese added, marked non-English as In Progress)
- Added sponsors.yml workflow for auto-generating sponsor avatars
2025-12-27 19:30:31 +05:30
|
|
|
ARG COMPRESSION_MODE=all
|
|
|
|
|
ENV COMPRESSION_MODE=$COMPRESSION_MODE
|
2025-12-09 14:02:40 +01:00
|
|
|
|
2026-01-27 15:51:03 +05:30
|
|
|
# global arg to local arg - BASE_URL is read from env by vite.config.ts
|
2025-12-09 14:02:40 +01:00
|
|
|
ARG BASE_URL
|
|
|
|
|
ENV BASE_URL=$BASE_URL
|
|
|
|
|
|
2026-02-02 15:14:30 +05:30
|
|
|
# WASM module URLs (pre-configured defaults)
|
|
|
|
|
# Override these for air-gapped or self-hosted WASM deployments
|
|
|
|
|
ARG VITE_WASM_PYMUPDF_URL
|
|
|
|
|
ARG VITE_WASM_GS_URL
|
|
|
|
|
ARG VITE_WASM_CPDF_URL
|
|
|
|
|
ENV VITE_WASM_PYMUPDF_URL=$VITE_WASM_PYMUPDF_URL
|
|
|
|
|
ENV VITE_WASM_GS_URL=$VITE_WASM_GS_URL
|
|
|
|
|
ENV VITE_WASM_CPDF_URL=$VITE_WASM_CPDF_URL
|
|
|
|
|
|
2026-03-14 15:50:30 +05:30
|
|
|
# OCR asset URLs (optional, used for self-hosted or air-gapped OCR)
|
|
|
|
|
ARG VITE_TESSERACT_WORKER_URL
|
|
|
|
|
ARG VITE_TESSERACT_CORE_URL
|
|
|
|
|
ARG VITE_TESSERACT_LANG_URL
|
|
|
|
|
ARG VITE_TESSERACT_AVAILABLE_LANGUAGES
|
|
|
|
|
ARG VITE_OCR_FONT_BASE_URL
|
|
|
|
|
ENV VITE_TESSERACT_WORKER_URL=$VITE_TESSERACT_WORKER_URL
|
|
|
|
|
ENV VITE_TESSERACT_CORE_URL=$VITE_TESSERACT_CORE_URL
|
|
|
|
|
ENV VITE_TESSERACT_LANG_URL=$VITE_TESSERACT_LANG_URL
|
|
|
|
|
ENV VITE_TESSERACT_AVAILABLE_LANGUAGES=$VITE_TESSERACT_AVAILABLE_LANGUAGES
|
|
|
|
|
ENV VITE_OCR_FONT_BASE_URL=$VITE_OCR_FONT_BASE_URL
|
|
|
|
|
|
2026-02-13 13:44:56 +05:30
|
|
|
# Default UI language (e.g. en, fr, de, es, zh, ar)
|
|
|
|
|
ARG VITE_DEFAULT_LANGUAGE
|
|
|
|
|
ENV VITE_DEFAULT_LANGUAGE=$VITE_DEFAULT_LANGUAGE
|
|
|
|
|
|
2026-02-14 21:38:58 +05:30
|
|
|
# Custom branding (e.g. VITE_BRAND_NAME=MyCompany VITE_BRAND_LOGO=my-logo.svg)
|
|
|
|
|
ARG VITE_BRAND_NAME
|
|
|
|
|
ARG VITE_BRAND_LOGO
|
|
|
|
|
ARG VITE_FOOTER_TEXT
|
|
|
|
|
ENV VITE_BRAND_NAME=$VITE_BRAND_NAME
|
|
|
|
|
ENV VITE_BRAND_LOGO=$VITE_BRAND_LOGO
|
|
|
|
|
ENV VITE_FOOTER_TEXT=$VITE_FOOTER_TEXT
|
|
|
|
|
|
2026-03-28 23:45:17 +05:30
|
|
|
ARG DISABLE_TOOLS
|
|
|
|
|
ENV DISABLE_TOOLS=$DISABLE_TOOLS
|
|
|
|
|
|
2026-01-27 16:40:57 +05:30
|
|
|
ENV NODE_OPTIONS="--max-old-space-size=3072"
|
2026-01-27 16:10:08 +05:30
|
|
|
|
2026-03-01 21:29:13 +05:30
|
|
|
RUN --mount=type=secret,id=VITE_CORS_PROXY_URL \
|
|
|
|
|
--mount=type=secret,id=VITE_CORS_PROXY_SECRET \
|
|
|
|
|
VITE_CORS_PROXY_URL=$(cat /run/secrets/VITE_CORS_PROXY_URL 2>/dev/null || echo "") \
|
|
|
|
|
VITE_CORS_PROXY_SECRET=$(cat /run/secrets/VITE_CORS_PROXY_SECRET 2>/dev/null || echo "") \
|
|
|
|
|
npm run build:with-docs
|
2025-10-12 18:23:13 +05:30
|
|
|
|
|
|
|
|
# Production stage
|
2026-04-04 12:46:48 +05:30
|
|
|
FROM quay.io/nginx/nginx-unprivileged:alpine-slim
|
2025-10-12 18:23:13 +05:30
|
|
|
|
2025-11-07 18:48:39 +01:00
|
|
|
LABEL org.opencontainers.image.source="https://github.com/alam00000/bentopdf"
|
2025-12-28 12:58:47 +05:30
|
|
|
LABEL org.opencontainers.image.url="https://github.com/alam00000/bentopdf"
|
2025-11-07 18:48:39 +01:00
|
|
|
|
2025-12-09 14:02:40 +01:00
|
|
|
# global arg to local arg
|
|
|
|
|
ARG BASE_URL
|
|
|
|
|
|
2026-01-02 23:26:24 +01:00
|
|
|
# Set this to "true" to disable Nginx listening on IPv6
|
|
|
|
|
ENV DISABLE_IPV6=false
|
2026-01-02 23:19:10 +01:00
|
|
|
|
2026-04-04 12:46:48 +05:30
|
|
|
USER root
|
2026-03-17 22:54:00 +05:30
|
|
|
RUN apk upgrade --no-cache
|
2026-04-04 12:46:48 +05:30
|
|
|
USER nginx
|
2026-03-17 22:54:00 +05:30
|
|
|
|
2025-12-09 14:02:40 +01:00
|
|
|
COPY --chown=nginx:nginx --from=builder /app/dist /usr/share/nginx/html${BASE_URL%/}
|
2025-10-24 00:36:40 -07:00
|
|
|
COPY --chown=nginx:nginx nginx.conf /etc/nginx/nginx.conf
|
2026-01-02 23:19:10 +01:00
|
|
|
COPY --chown=nginx:nginx --chmod=755 nginx-ipv6.sh /docker-entrypoint.d/99-disable-ipv6.sh
|
2026-04-04 12:46:48 +05:30
|
|
|
RUN mkdir -p /etc/nginx/tmp && chown -R nginx:nginx /etc/nginx/tmp
|
2026-04-01 14:08:28 +05:30
|
|
|
|
2025-10-25 00:53:18 -07:00
|
|
|
EXPOSE 8080
|
2025-10-23 19:42:34 -07:00
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|