Use slim container for node build

This commit is contained in:
Jake Howard 2022-08-27 15:20:13 +01:00
parent 6c19835cac
commit 0da37bb064
Signed by: jake
GPG key ID: 57AFB45680EDD477
2 changed files with 3 additions and 5 deletions

View file

@ -4,14 +4,12 @@ stages:
- deploy - deploy
static: static:
image: node:alpine image: node:16-slim
stage: build stage: build
cache: cache:
key: npm-$CI_COMMIT_REF_SLUG key: npm-$CI_COMMIT_REF_SLUG
paths: paths:
- "$CI_PROJECT_DIR/.npm-cache" - "$CI_PROJECT_DIR/.npm-cache"
before_script:
- apk add --no-cache bash
script: script:
- npm ci --cache .npm-cache --prefer-offline - npm ci --cache .npm-cache --prefer-offline
- npm run build - npm run build
@ -125,7 +123,7 @@ djhtml:
- git ls-files '*.html' | xargs djhtml --check --tabwidth 2 - git ls-files '*.html' | xargs djhtml --check --tabwidth 2
npm_lint: npm_lint:
image: node:alpine image: node:16-slim
stage: test stage: test
dependencies: dependencies:
- static - static

View file

@ -1,4 +1,4 @@
FROM node:16 as frontend FROM node:16-slim as frontend
COPY package.json package-lock.json ./ COPY package.json package-lock.json ./
RUN npm ci --no-audit --progress=false --omit=dev RUN npm ci --no-audit --progress=false --omit=dev