slimmer node build
This commit is contained in:
parent
29d3ee3f87
commit
ff91c085ae
33
Dockerfile
33
Dockerfile
@ -1,21 +1,29 @@
|
|||||||
# =============================================================================
|
# =============================================================================
|
||||||
# Job Ops - Unified Docker Image
|
# Job Ops - Slim Docker Image
|
||||||
# Contains: Orchestrator (Node.js), Job Crawler, Resume Generator (Python/Playwright)
|
# Only includes Firefox (for Camoufox) - much smaller than full Playwright
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
|
|
||||||
FROM mcr.microsoft.com/playwright:v1.49.1-jammy
|
FROM node:20-slim AS base
|
||||||
|
|
||||||
|
# Install system dependencies for browsers and Python
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
python3 \
|
||||||
|
python3-pip \
|
||||||
|
curl \
|
||||||
|
# Firefox dependencies
|
||||||
|
libgtk-3-0 \
|
||||||
|
libdbus-glib-1-2 \
|
||||||
|
libxt6 \
|
||||||
|
libx11-xcb1 \
|
||||||
|
libasound2 \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Set working directory
|
# Set working directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install Node.js 20.x and Python
|
# Install Playwright and Firefox only
|
||||||
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
|
RUN pip3 install --no-cache-dir --break-system-packages playwright && \
|
||||||
apt-get update && \
|
npx playwright install firefox
|
||||||
apt-get install -y nodejs python3 python3-pip && \
|
|
||||||
npm install -g pnpm
|
|
||||||
|
|
||||||
# Install Python dependencies for resume generator
|
|
||||||
RUN pip3 install --no-cache-dir playwright
|
|
||||||
|
|
||||||
# Copy package files first for better caching
|
# Copy package files first for better caching
|
||||||
COPY orchestrator/package*.json ./orchestrator/
|
COPY orchestrator/package*.json ./orchestrator/
|
||||||
@ -28,6 +36,9 @@ RUN npm install --production=false
|
|||||||
WORKDIR /app/job-extractor
|
WORKDIR /app/job-extractor
|
||||||
RUN npm install --production=false
|
RUN npm install --production=false
|
||||||
|
|
||||||
|
# Install Camoufox browser (downloads its own Firefox fork)
|
||||||
|
RUN npx camoufox fetch
|
||||||
|
|
||||||
# Copy source code
|
# Copy source code
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY orchestrator ./orchestrator
|
COPY orchestrator ./orchestrator
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user