Files
SnapOtter/docker/Dockerfile.test
T
SnapOtter 7f131d99a6 fix: QA sweep -- SSE crash, memory leaks, HEIC Docker decode, TGA detection, lint cleanup
- Fix SSE write-after-end crash in progress.ts (remove callback before ending stream)
- Fix blob URL memory leaks: revoke processedPreviewUrl and old HEIC preview URLs
- Add AbortController to batch fetch in use-tool-processor and use-pipeline-processor
- Fix TGA format misidentified as CUR (extension overrides magic bytes)
- Add libheif-plugin-libde265 to Docker for HEIC/HEIF decode support
- Remove unused imports and state (AppLayout, setSampledColor, useEffect)
- Fix non-null assertions in meme-text-renderer and meme-generator
- Fix confusing void type in meme-templates
- Remove unnecessary useEffect deps in adjustments-panel
- Fix Playwright strict mode violations in 5 E2E tests
2026-05-09 13:55:00 +08:00

58 lines
1.9 KiB
Docker

# ============================================
# SnapOtter - Test Dockerfile
# Runs the full test suite (unit + integration)
# ============================================
FROM node:22-bookworm
RUN corepack enable && corepack prepare pnpm@9.15.4 --activate
RUN apt-get update && apt-get install -y --no-install-recommends \
libheif-examples \
libimage-exiftool-perl \
imagemagick \
libraw-dev \
&& if apt-cache show libheif-plugin-libde265 >/dev/null 2>&1; then \
apt-get install -y --no-install-recommends libheif-plugin-libde265; \
fi \
&& if apt-cache show libheif-plugin-x265 >/dev/null 2>&1; then \
apt-get install -y --no-install-recommends libheif-plugin-x265; \
fi \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy workspace config first (for layer caching)
COPY pnpm-workspace.yaml pnpm-lock.yaml package.json turbo.json tsconfig.base.json vitest.config.ts ./
# Copy all package.json files
COPY apps/web/package.json apps/web/tsconfig.json apps/web/vite.config.ts ./apps/web/
COPY apps/api/package.json apps/api/tsconfig.json ./apps/api/
COPY packages/shared/package.json packages/shared/tsconfig.json ./packages/shared/
COPY packages/image-engine/package.json packages/image-engine/tsconfig.json ./packages/image-engine/
COPY packages/ai/package.json packages/ai/tsconfig.json ./packages/ai/
# Install ALL dependencies (including devDependencies for testing)
RUN pnpm install --frozen-lockfile
# Copy source code
COPY . .
# Environment for tests
ENV NODE_ENV=test \
AUTH_ENABLED=true \
DEFAULT_USERNAME=admin \
DEFAULT_PASSWORD=admin \
DB_PATH=/tmp/test-snapotter.db \
WORKSPACE_PATH=/tmp/test-workspace \
MAX_MEGAPIXELS=100 \
MAX_UPLOAD_SIZE_MB=100 \
MAX_BATCH_SIZE=200 \
CONCURRENT_JOBS=3 \
RATE_LIMIT_PER_MIN=1000 \
FILE_MAX_AGE_HOURS=1 \
CLEANUP_INTERVAL_MINUTES=60
# Run unit + integration tests with coverage
CMD ["pnpm", "test:all"]