npm ci can fail when package-lock.json has minor mismatches with package.json. npm install is more forgiving and appropriate for Docker builds where determinism is less critical than reliability. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
62 lines
1.4 KiB
Docker
62 lines
1.4 KiB
Docker
# Build stage
|
|
# Image: code.cannabrands.app/creationshop/dispensary-scraper
|
|
FROM code.cannabrands.app/creationshop/node:20-slim AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package*.json ./
|
|
RUN npm install
|
|
|
|
COPY . .
|
|
RUN npm run build
|
|
|
|
# Production stage
|
|
FROM code.cannabrands.app/creationshop/node:20-slim
|
|
|
|
# Build arguments for version info
|
|
ARG APP_BUILD_VERSION=dev
|
|
ARG APP_GIT_SHA=unknown
|
|
ARG APP_BUILD_TIME=unknown
|
|
ARG CONTAINER_IMAGE_TAG=local
|
|
|
|
# Set version info as environment variables
|
|
ENV APP_BUILD_VERSION=${APP_BUILD_VERSION}
|
|
ENV APP_GIT_SHA=${APP_GIT_SHA}
|
|
ENV APP_BUILD_TIME=${APP_BUILD_TIME}
|
|
ENV CONTAINER_IMAGE_TAG=${CONTAINER_IMAGE_TAG}
|
|
|
|
# Install Chromium dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
chromium \
|
|
fonts-liberation \
|
|
libnss3 \
|
|
libxss1 \
|
|
libasound2 \
|
|
libatk-bridge2.0-0 \
|
|
libgtk-3-0 \
|
|
--no-install-recommends \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
|
|
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package*.json ./
|
|
RUN npm install --omit=dev
|
|
|
|
COPY --from=builder /app/dist ./dist
|
|
|
|
# Copy migrations for auto-migrate on startup
|
|
COPY migrations ./migrations
|
|
|
|
# Create local images directory for when MinIO is not configured
|
|
RUN mkdir -p /app/public/images/products
|
|
|
|
# Copy static downloads (plugin files, etc.)
|
|
COPY public/downloads /app/public/downloads
|
|
|
|
EXPOSE 3010
|
|
|
|
CMD ["node", "dist/index.js"]
|