How to reduce GitHub Actions build time and Docker image size
I have a GitHub Actions workflow that builds and deploys from the dev environment to the prod environment. Currently, the build job takes around 19–20 minutes, but I want to reduce this to about 5–6 minutes maximum. Here is my Dockerfile: FROM node:22-alpine AS base RUN apk add --no-cache \ build-base \ cairo-dev \ pango-dev \ jpeg-dev \ giflib-dev \ librsvg-dev \ python3 \ make \ g++ # Upgrade npm to latest RUN npm install -g npm@latest WORKDIR /app # Install dependencies first (cache if unchanged) COPY package*.json ./ RUN npm install # Copy rest of source COPY . . COPY .env.production .env
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.