ci: Add slim Dockerfile.ci files for faster CI builds
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
- Add Dockerfile.ci for backend, cannaiq, findadispo, findagram - Frontend Dockerfiles just copy pre-built assets to nginx - Backend Dockerfile copies pre-built dist/node_modules - Reduces Docker build time by doing npm ci/build in CI step 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
43
backend/Dockerfile.ci
Normal file
43
backend/Dockerfile.ci
Normal file
@@ -0,0 +1,43 @@
|
||||
# CI Dockerfile - assets pre-built in CI step
|
||||
# No npm install or build - just copy and run
|
||||
FROM node:22-slim
|
||||
|
||||
# Build arguments for version info
|
||||
ARG APP_BUILD_VERSION=dev
|
||||
ARG APP_GIT_SHA=unknown
|
||||
ARG APP_BUILD_TIME=unknown
|
||||
|
||||
ENV APP_BUILD_VERSION=${APP_BUILD_VERSION}
|
||||
ENV APP_GIT_SHA=${APP_GIT_SHA}
|
||||
ENV APP_BUILD_TIME=${APP_BUILD_TIME}
|
||||
|
||||
# Install runtime dependencies only (Chromium for Puppeteer)
|
||||
RUN apt-get update && apt-get install -y \
|
||||
curl \
|
||||
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 pre-built assets from CI
|
||||
COPY backend/package*.json ./
|
||||
COPY backend/node_modules ./node_modules
|
||||
COPY backend/dist ./dist
|
||||
COPY backend/migrations ./migrations
|
||||
COPY backend/public/downloads ./public/downloads
|
||||
|
||||
RUN mkdir -p /app/public/images/products
|
||||
|
||||
EXPOSE 3010
|
||||
|
||||
CMD ["node", "dist/index.js"]
|
||||
Reference in New Issue
Block a user