From 5edebd4433d54198faf0df7a8fb3bef0801b3d3c Mon Sep 17 00:00:00 2001 From: Jacek Wielemborek Date: Sat, 25 Oct 2025 14:16:16 +0200 Subject: [PATCH] =?UTF-8?q?Dodaj=20wsparcie=20Docker=20i=20dokumentacj?= =?UTF-8?q?=C4=99=20Claude=20Code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Dodano Dockerfile z multi-stage build (artifacts + dev environment) - Dodano .dockerignore dla optymalizacji budowania - Dodano CLAUDE.md z dokumentacjÄ… architektury i workflow dla Claude Code --- .dockerignore | 16 ++++++++++++++++ Dockerfile | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..d3ecaee --- /dev/null +++ b/.dockerignore @@ -0,0 +1,16 @@ +.log +node_modules +sidebar.js +web-ext-artifacts/ +lib/* +yarn-error.log +rentgen.zip + +# Generated PNG icons (build artifacts) +assets/icons/*.png +assets/icon-addon-*.png + +# Exception: do not ignore the `browser-api` directory inside `lib` +!/lib/browser-api/ + +Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..78cfa5d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,45 @@ +# Rentgen Browser Extension - Docker Build +# +# Usage: +# Build and extract artifacts directly: +# docker buildx build . --output artifacts +# +# Or traditional build (creates full development environment): +# docker build -t rentgen . +# docker run --rm rentgen ls -lh /app/web-ext-artifacts/ +# +# Run commands in the container: +# docker run --rm rentgen npm run build:chrome +# docker run --rm rentgen npm run typecheck + +# Build stage +FROM node:lts AS builder + +WORKDIR /app + +# Copy package files for dependency installation (better layer caching) +COPY package.json package-lock.json ./ + +# Install dependencies +RUN npm install + +# Copy source code (respecting .dockerignore) +COPY . . + +# Build the extension for Firefox (default) +RUN npm run build + +# Create the package +RUN npm run create-package + +# Artifacts stage - only contains the built artifacts (for --output) +FROM scratch AS artifacts + +# Copy only the built extension zip file to root +COPY --from=builder /app/web-ext-artifacts/*.zip / + +# Default stage - full development environment +FROM builder + +# Default command shows the built artifact +CMD ["ls", "-lh", "/app/web-ext-artifacts/"]