2026-03-20 19:19:20 +01:00
|
|
|
FROM node:22-slim
|
2025-12-10 13:23:17 +01:00
|
|
|
|
2026-05-10 15:42:31 +02:00
|
|
|
# System deps for CloakBrowser + build tools for native modules (better-sqlite3)
|
|
|
|
|
# fonts-noto-color-emoji and fonts-freefont-ttf are required so canvas fingerprint
|
|
|
|
|
# hashes match real browsers; missing emoji fonts cause bot detection on Kasada/Akamai.
|
2026-03-20 19:19:20 +01:00
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
|
|
|
curl ca-certificates fonts-liberation libasound2 \
|
|
|
|
|
libatk-bridge2.0-0 libatk1.0-0 libcups2 libdbus-1-3 \
|
|
|
|
|
libdrm2 libgbm1 libgtk-3-0 libnspr4 libnss3 \
|
|
|
|
|
libx11-xcb1 libxcomposite1 libxdamage1 libxrandr2 xdg-utils \
|
2026-05-10 15:42:31 +02:00
|
|
|
fonts-noto-color-emoji fonts-freefont-ttf \
|
2026-03-20 19:19:20 +01:00
|
|
|
python3 make g++ \
|
|
|
|
|
&& rm -rf /var/lib/apt/lists/* \
|
2026-03-22 09:41:20 +01:00
|
|
|
&& mkdir -p /db /conf /fredy
|
2024-04-22 16:14:27 +02:00
|
|
|
|
2025-05-15 10:16:43 +02:00
|
|
|
WORKDIR /fredy
|
2024-04-22 16:14:27 +02:00
|
|
|
|
2025-12-18 19:16:28 +01:00
|
|
|
ENV NODE_ENV=production \
|
2026-03-20 19:19:20 +01:00
|
|
|
IS_DOCKER=true
|
2025-05-15 10:37:21 +02:00
|
|
|
|
2026-03-22 09:41:20 +01:00
|
|
|
COPY package.json yarn.lock ./
|
2024-04-22 16:14:27 +02:00
|
|
|
|
2026-03-20 19:19:20 +01:00
|
|
|
# Install dependencies and purge build tools (only needed to compile better-sqlite3)
|
|
|
|
|
RUN yarn config set network-timeout 600000 \
|
|
|
|
|
&& yarn --frozen-lockfile \
|
|
|
|
|
&& yarn cache clean
|
2025-05-16 15:03:28 +02:00
|
|
|
|
2026-05-10 15:42:31 +02:00
|
|
|
# Pre-download the CloakBrowser stealth Chromium binary (supports x86_64 and arm64)
|
|
|
|
|
RUN node -e "import('cloakbrowser').then(({ensureBinary}) => ensureBinary())"
|
2025-12-10 13:23:17 +01:00
|
|
|
|
2026-03-20 19:19:20 +01:00
|
|
|
# Purge build tools now that native modules are compiled
|
|
|
|
|
RUN apt-get purge -y python3 make g++ \
|
|
|
|
|
&& apt-get autoremove -y \
|
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
2025-05-16 15:03:28 +02:00
|
|
|
|
2026-03-22 09:41:20 +01:00
|
|
|
COPY index.html vite.config.js ./
|
|
|
|
|
COPY ui ./ui
|
|
|
|
|
COPY lib ./lib
|
2026-03-20 19:19:20 +01:00
|
|
|
|
|
|
|
|
RUN yarn build:frontend
|
|
|
|
|
|
2026-03-22 09:41:20 +01:00
|
|
|
COPY index.js ./
|
2026-03-20 19:19:20 +01:00
|
|
|
|
|
|
|
|
RUN ln -s /db /fredy/db \
|
2025-05-26 13:20:12 +02:00
|
|
|
&& ln -s /conf /fredy/conf
|
2025-05-16 15:03:28 +02:00
|
|
|
|
2022-01-24 16:41:23 +01:00
|
|
|
EXPOSE 9998
|
2025-09-29 12:31:32 +02:00
|
|
|
VOLUME /db
|
|
|
|
|
VOLUME /conf
|
2025-05-16 15:03:28 +02:00
|
|
|
|
2026-03-20 19:19:20 +01:00
|
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
|
|
|
|
|
CMD curl -f http://localhost:9998/ || exit 1
|
|
|
|
|
|
2025-12-10 13:23:17 +01:00
|
|
|
CMD ["node", "index.js"]
|