WIP: Dodaj wsparcie dla Dockera #128

Draft
d33tah wants to merge 51 commits from d33tah/rentgen:develop into develop
2 changed files with 61 additions and 0 deletions
Showing only changes of commit 5edebd4433 - Show all commits

16
.dockerignore Normal file
View File

@ -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

45
Dockerfile Normal file
View File

@ -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/"]